(BOOT-STRAP NQTHM)
[ 0.1 0.1 0.0 ]
GROUND-ZERO
(DEFN DELETE
(X L)
(IF (LISTP L)
(IF (EQUAL X (CAR L))
(CDR L)
(CONS (CAR L) (DELETE X (CDR L))))
L))
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT L) decreases according to the well-founded relation LESSP in each
recursive call. Hence, DELETE is accepted under the principle of definition.
[ 0.0 0.0 0.0 ]
DELETE
(DEFN BAGDIFF
(X Y)
(IF (LISTP Y)
(IF (MEMBER (CAR Y) X)
(BAGDIFF (DELETE (CAR Y) X) (CDR Y))
(BAGDIFF X (CDR Y)))
X))
Linear arithmetic and the lemma CDR-LESSP inform us that the measure
(COUNT Y) decreases according to the well-founded relation LESSP in each
recursive call. Hence, BAGDIFF is accepted under the definitional principle.
[ 0.0 0.0 0.0 ]
BAGDIFF
(DEFN BAGINT
(X Y)
(IF (LISTP X)
(IF (MEMBER (CAR X) Y)
(CONS (CAR X)
(BAGINT (CDR X) (DELETE (CAR X) Y)))
(BAGINT (CDR X) Y))
NIL))
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT X) decreases according to the well-founded relation LESSP in each
recursive call. Hence, BAGINT is accepted under the principle of definition.
Note that (OR (LITATOM (BAGINT X Y)) (LISTP (BAGINT X Y))) is a theorem.
[ 0.0 0.0 0.0 ]
BAGINT
(DEFN OCCURRENCES
(X L)
(IF (LISTP L)
(IF (EQUAL X (CAR L))
(ADD1 (OCCURRENCES X (CDR L)))
(OCCURRENCES X (CDR L)))
0))
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT L) decreases according to the well-founded relation LESSP in each
recursive call. Hence, OCCURRENCES is accepted under the principle of
definition. From the definition we can conclude that:
(NUMBERP (OCCURRENCES X L))
is a theorem.
[ 0.0 0.0 0.0 ]
OCCURRENCES
(DEFN SUBBAGP
(X Y)
(IF (LISTP X)
(IF (MEMBER (CAR X) Y)
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
F)
T))
Linear arithmetic and the lemma CDR-LESSP establish that the measure
(COUNT X) decreases according to the well-founded relation LESSP in each
recursive call. Hence, SUBBAGP is accepted under the principle of definition.
From the definition we can conclude that:
(OR (FALSEP (SUBBAGP X Y))
(TRUEP (SUBBAGP X Y)))
is a theorem.
[ 0.0 0.0 0.0 ]
SUBBAGP
(LEMMA LISTP-DELETE
(REWRITE)
(EQUAL (LISTP (DELETE X L))
(IF (LISTP L)
(OR (NOT (EQUAL X (CAR L)))
(LISTP (CDR L)))
F))
((ENABLE DELETE)
(INDUCT (DELETE X L))))
This conjecture can be simplified, using the abbreviations NOT, OR, and AND,
to three new conjectures:
Case 3. (IMPLIES (AND (LISTP L) (EQUAL X (CAR L)))
(EQUAL (LISTP (DELETE X L))
(IF (LISTP L)
(OR (NOT (EQUAL X (CAR L)))
(LISTP (CDR L)))
F))),
which simplifies, opening up the definitions of DELETE, NOT, and OR, to:
T.
Case 2. (IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(EQUAL (LISTP (DELETE X (CDR L)))
(IF (LISTP (CDR L))
(OR (NOT (EQUAL X (CADR L)))
(LISTP (CDDR L)))
F)))
(EQUAL (LISTP (DELETE X L))
(IF (LISTP L)
(OR (NOT (EQUAL X (CAR L)))
(LISTP (CDR L)))
F))),
which simplifies, applying CONS-CAR-CDR, and unfolding DELETE, NOT, OR, and
EQUAL, to:
T.
Case 1. (IMPLIES (NOT (LISTP L))
(EQUAL (LISTP (DELETE X L))
(IF (LISTP L)
(OR (NOT (EQUAL X (CAR L)))
(LISTP (CDR L)))
F))).
This simplifies, opening up DELETE and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LISTP-DELETE
(DISABLE LISTP-DELETE)
[ 0.0 0.0 0.0 ]
LISTP-DELETE-OFF
(LEMMA DELETE-NON-MEMBER
(REWRITE)
(IMPLIES (NOT (MEMBER X Y))
(EQUAL (DELETE X Y) Y))
((ENABLE DELETE)))
Give the conjecture the name *1.
We will try to prove it by induction. There are two plausible inductions.
However, they merge into one likely candidate induction. We will induct
according to the following scheme:
(AND (IMPLIES (NLISTP Y) (p X Y))
(IMPLIES (AND (NOT (NLISTP Y))
(EQUAL X (CAR Y)))
(p X Y))
(IMPLIES (AND (NOT (NLISTP Y))
(NOT (EQUAL X (CAR Y)))
(p X (CDR Y)))
(p X Y))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT Y) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme generates four new goals:
Case 4. (IMPLIES (AND (NLISTP Y) (NOT (MEMBER X Y)))
(EQUAL (DELETE X Y) Y)),
which simplifies, expanding NLISTP, MEMBER, and DELETE, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP Y))
(EQUAL X (CAR Y))
(NOT (MEMBER X Y)))
(EQUAL (DELETE X Y) Y)),
which simplifies, opening up the functions NLISTP and MEMBER, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP Y))
(NOT (EQUAL X (CAR Y)))
(MEMBER X (CDR Y))
(NOT (MEMBER X Y)))
(EQUAL (DELETE X Y) Y)),
which simplifies, opening up the definitions of NLISTP and MEMBER, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP Y))
(NOT (EQUAL X (CAR Y)))
(EQUAL (DELETE X (CDR Y)) (CDR Y))
(NOT (MEMBER X Y)))
(EQUAL (DELETE X Y) Y)),
which simplifies, rewriting with the lemma CONS-CAR-CDR, and unfolding the
functions NLISTP, MEMBER, and DELETE, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
DELETE-NON-MEMBER
(LEMMA DELETE-DELETE
(REWRITE)
(EQUAL (DELETE Y (DELETE X Z))
(DELETE X (DELETE Y Z)))
((ENABLE DELETE DELETE-NON-MEMBER)))
Call the conjecture *1.
Perhaps we can prove it by induction. Two inductions are suggested by
terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP Z) (EQUAL X (CAR Z)))
(p Y X Z))
(IMPLIES (AND (LISTP Z)
(NOT (EQUAL X (CAR Z)))
(p Y X (CDR Z)))
(p Y X Z))
(IMPLIES (NOT (LISTP Z)) (p Y X Z))).
Linear arithmetic and the lemma CDR-LESSP can be used to prove that the
measure (COUNT Z) decreases according to the well-founded relation LESSP in
each induction step of the scheme. The above induction scheme leads to three
new goals:
Case 3. (IMPLIES (AND (LISTP Z) (EQUAL X (CAR Z)))
(EQUAL (DELETE Y (DELETE X Z))
(DELETE X (DELETE Y Z)))),
which simplifies, opening up the definition of DELETE, to two new
conjectures:
Case 3.2.
(IMPLIES (AND (LISTP Z)
(NOT (EQUAL Y (CAR Z))))
(EQUAL (DELETE Y (CDR Z))
(DELETE (CAR Z)
(CONS (CAR Z) (DELETE Y (CDR Z)))))),
which again simplifies, rewriting with CDR-CONS and CAR-CONS, and opening
up the function DELETE, to:
T.
Case 3.1.
(IMPLIES (AND (LISTP Z) (EQUAL Y (CAR Z)))
(EQUAL (DELETE Y (CDR Z))
(DELETE (CAR Z) (CDR Z)))).
This again simplifies, obviously, to:
T.
Case 2. (IMPLIES (AND (LISTP Z)
(NOT (EQUAL X (CAR Z)))
(EQUAL (DELETE Y (DELETE X (CDR Z)))
(DELETE X (DELETE Y (CDR Z)))))
(EQUAL (DELETE Y (DELETE X Z))
(DELETE X (DELETE Y Z)))).
This simplifies, applying CDR-CONS and CAR-CONS, and opening up DELETE, to:
(IMPLIES (AND (LISTP Z)
(NOT (EQUAL X (CAR Z)))
(EQUAL (DELETE Y (DELETE X (CDR Z)))
(DELETE X (DELETE Y (CDR Z))))
(NOT (EQUAL Y (CAR Z))))
(EQUAL (CONS (CAR Z)
(DELETE X (DELETE Y (CDR Z))))
(DELETE X
(CONS (CAR Z) (DELETE Y (CDR Z)))))).
But this again simplifies, rewriting with the lemmas CDR-CONS and CAR-CONS,
and expanding the definition of DELETE, to:
T.
Case 1. (IMPLIES (NOT (LISTP Z))
(EQUAL (DELETE Y (DELETE X Z))
(DELETE X (DELETE Y Z)))),
which simplifies, applying DELETE-NON-MEMBER, and expanding the definition
of MEMBER, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
DELETE-DELETE
(LEMMA EQUAL-OCCURRENCES-ZERO
(REWRITE)
(EQUAL (EQUAL (OCCURRENCES X L) 0)
(NOT (MEMBER X L)))
((ENABLE OCCURRENCES)))
This conjecture simplifies, unfolding NOT, to two new conjectures:
Case 2. (IMPLIES (NOT (EQUAL (OCCURRENCES X L) 0))
(MEMBER X L)),
which we will name *1.
Case 1. (IMPLIES (EQUAL (OCCURRENCES X L) 0)
(NOT (MEMBER X L))),
which we would usually push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us consider:
(EQUAL (EQUAL (OCCURRENCES X L) 0)
(NOT (MEMBER X L))).
We gave this the name *1 above. Perhaps we can prove it by induction. Two
inductions are suggested by terms in the conjecture. However, they merge into
one likely candidate induction. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LISTP L)
(EQUAL X (CAR L))
(p X (CDR L)))
(p X L))
(IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(p X (CDR L)))
(p X L))
(IMPLIES (NOT (LISTP L)) (p X L))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT L)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme leads to the following three new
formulas:
Case 3. (IMPLIES (AND (LISTP L)
(EQUAL X (CAR L))
(EQUAL (EQUAL (OCCURRENCES X (CDR L)) 0)
(NOT (MEMBER X (CDR L)))))
(EQUAL (EQUAL (OCCURRENCES X L) 0)
(NOT (MEMBER X L)))).
This simplifies, unfolding the definitions of NOT, OCCURRENCES, MEMBER,
EQUAL, and ADD1, to:
T.
Case 2. (IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(EQUAL (EQUAL (OCCURRENCES X (CDR L)) 0)
(NOT (MEMBER X (CDR L)))))
(EQUAL (EQUAL (OCCURRENCES X L) 0)
(NOT (MEMBER X L)))).
This simplifies, expanding the definitions of NOT, OCCURRENCES, MEMBER, and
EQUAL, to:
T.
Case 1. (IMPLIES (NOT (LISTP L))
(EQUAL (EQUAL (OCCURRENCES X L) 0)
(NOT (MEMBER X L)))).
This simplifies, expanding the definitions of OCCURRENCES, EQUAL, MEMBER,
and NOT, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-OCCURRENCES-ZERO
(LEMMA MEMBER-NON-LIST
(REWRITE)
(IMPLIES (NOT (LISTP L))
(NOT (MEMBER X L))))
This formula simplifies, opening up the definition of MEMBER, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
MEMBER-NON-LIST
(LEMMA MEMBER-DELETE
(REWRITE)
(EQUAL (MEMBER X (DELETE Y L))
(IF (MEMBER X L)
(IF (EQUAL X Y)
(LESSP 1 (OCCURRENCES X L))
T)
F))
((ENABLE DELETE OCCURRENCES)))
This simplifies, obviously, to three new goals:
Case 3. (IMPLIES (NOT (MEMBER X L))
(EQUAL (MEMBER X (DELETE Y L)) F)),
which again simplifies, trivially, to:
(IMPLIES (NOT (MEMBER X L))
(NOT (MEMBER X (DELETE Y L)))),
which we will name *1.
Case 2. (IMPLIES (AND (MEMBER X L) (EQUAL X Y))
(EQUAL (MEMBER X (DELETE Y L))
(LESSP 1 (OCCURRENCES X L)))).
This again simplifies, obviously, to:
(IMPLIES (MEMBER Y L)
(EQUAL (MEMBER Y (DELETE Y L))
(LESSP 1 (OCCURRENCES Y L)))),
which we would normally push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us return to:
(EQUAL (MEMBER X (DELETE Y L))
(IF (MEMBER X L)
(IF (EQUAL X Y)
(LESSP 1 (OCCURRENCES X L))
T)
F)).
We named this *1. We will try to prove it by induction. There are three
plausible inductions. However, they merge into one likely candidate induction.
We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP L) (EQUAL Y (CAR L)))
(p X Y L))
(IMPLIES (AND (LISTP L)
(NOT (EQUAL Y (CAR L)))
(p X Y (CDR L)))
(p X Y L))
(IMPLIES (NOT (LISTP L)) (p X Y L))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure (COUNT L)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme produces three new conjectures:
Case 3. (IMPLIES (AND (LISTP L) (EQUAL Y (CAR L)))
(EQUAL (MEMBER X (DELETE Y L))
(IF (MEMBER X L)
(IF (EQUAL X Y)
(LESSP 1 (OCCURRENCES X L))
T)
F))),
which simplifies, applying SUB1-ADD1, and unfolding DELETE, MEMBER,
OCCURRENCES, SUB1, NUMBERP, EQUAL, and LESSP, to the following four new
conjectures:
Case 3.4.
(IMPLIES (AND (LISTP L)
(EQUAL X (CAR L))
(NOT (EQUAL (OCCURRENCES X (CDR L)) 0)))
(EQUAL (MEMBER X (CDR L)) T)).
This again simplifies, clearly, to:
(IMPLIES (AND (LISTP L)
(NOT (EQUAL (OCCURRENCES (CAR L) (CDR L))
0)))
(MEMBER (CAR L) (CDR L))).
Applying the lemma CAR-CDR-ELIM, replace L by (CONS Z V) to eliminate
(CAR L) and (CDR L). We thus obtain:
(IMPLIES (NOT (EQUAL (OCCURRENCES Z V) 0))
(MEMBER Z V)),
which we will name *1.1.
Case 3.3.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(MEMBER X (CDR L)))
(EQUAL (MEMBER X (CDR L)) T)).
This again simplifies, clearly, to:
T.
Case 3.2.
(IMPLIES (AND (LISTP L)
(EQUAL X (CAR L))
(EQUAL (OCCURRENCES X (CDR L)) 0))
(EQUAL (MEMBER X (CDR L)) F)).
This again simplifies, clearly, to:
(IMPLIES (AND (LISTP L)
(EQUAL (OCCURRENCES (CAR L) (CDR L))
0))
(NOT (MEMBER (CAR L) (CDR L)))).
Applying the lemma CAR-CDR-ELIM, replace L by (CONS Z V) to eliminate
(CAR L) and (CDR L). We would thus like to prove the new formula:
(IMPLIES (EQUAL (OCCURRENCES Z V) 0)
(NOT (MEMBER Z V))),
which we will name *1.2.
Case 3.1.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL X (CAR L)))
(NOT (MEMBER X (CDR L))))
(EQUAL (MEMBER X (CDR L)) F)).
This again simplifies, trivially, to:
T.
Case 2. (IMPLIES (AND (LISTP L)
(NOT (EQUAL Y (CAR L)))
(EQUAL (MEMBER X (DELETE Y (CDR L)))
(IF (MEMBER X (CDR L))
(IF (EQUAL X Y)
(LESSP 1 (OCCURRENCES X (CDR L)))
T)
F)))
(EQUAL (MEMBER X (DELETE Y L))
(IF (MEMBER X L)
(IF (EQUAL X Y)
(LESSP 1 (OCCURRENCES X L))
T)
F))).
This simplifies, applying CDR-CONS, CAR-CONS, and SUB1-ADD1, and opening up
the definitions of DELETE, MEMBER, OCCURRENCES, SUB1, NUMBERP, EQUAL, and
LESSP, to three new formulas:
Case 2.3.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL Y (CAR L)))
(NOT (MEMBER X (CDR L)))
(EQUAL (MEMBER X (DELETE Y (CDR L)))
F)
(EQUAL X (CAR L))
(EQUAL X Y))
(NOT (EQUAL (OCCURRENCES X (CDR L)) 0))),
which again simplifies, clearly, to:
T.
Case 2.2.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL Y (CAR L)))
(MEMBER X (CDR L))
(EQUAL X Y)
(EQUAL (MEMBER X (DELETE Y (CDR L)))
(LESSP 1 (OCCURRENCES X (CDR L))))
(NOT (EQUAL X (CAR L))))
(EQUAL (MEMBER X
(CONS (CAR L) (DELETE X (CDR L))))
(LESSP 1 (OCCURRENCES X (CDR L))))).
This again simplifies, applying CDR-CONS and CAR-CONS, and expanding
MEMBER, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL Y (CAR L)))
(MEMBER X (CDR L))
(EQUAL X Y)
(EQUAL (MEMBER X (DELETE Y (CDR L)))
(LESSP 1 (OCCURRENCES X (CDR L))))
(EQUAL X (CAR L)))
(EQUAL (MEMBER X (CDR L))
(LESSP 1
(ADD1 (OCCURRENCES X (CDR L)))))).
This again simplifies, trivially, to:
T.
Case 1. (IMPLIES (NOT (LISTP L))
(EQUAL (MEMBER X (DELETE Y L))
(IF (MEMBER X L)
(IF (EQUAL X Y)
(LESSP 1 (OCCURRENCES X L))
T)
F))).
This simplifies, unfolding the functions DELETE, MEMBER, and EQUAL, to:
T.
So next consider:
(IMPLIES (EQUAL (OCCURRENCES Z V) 0)
(NOT (MEMBER Z V))),
which we named *1.2 above. We will appeal to induction. Two inductions are
suggested by terms in the conjecture. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP V)
(EQUAL Z (CAR V))
(p Z (CDR V)))
(p Z V))
(IMPLIES (AND (LISTP V)
(NOT (EQUAL Z (CAR V)))
(p Z (CDR V)))
(p Z V))
(IMPLIES (NOT (LISTP V)) (p Z V))).
Linear arithmetic and the lemma CDR-LESSP can be used to prove that the
measure (COUNT V) decreases according to the well-founded relation LESSP in
each induction step of the scheme. The above induction scheme produces five
new conjectures:
Case 5. (IMPLIES (AND (LISTP V)
(EQUAL Z (CAR V))
(NOT (EQUAL (OCCURRENCES Z (CDR V)) 0))
(EQUAL (OCCURRENCES Z V) 0))
(NOT (MEMBER Z V))),
which simplifies, expanding the function OCCURRENCES, to:
T.
Case 4. (IMPLIES (AND (LISTP V)
(EQUAL Z (CAR V))
(NOT (MEMBER Z (CDR V)))
(EQUAL (OCCURRENCES Z V) 0))
(NOT (MEMBER Z V))),
which simplifies, expanding the definition of OCCURRENCES, to:
T.
Case 3. (IMPLIES (AND (LISTP V)
(NOT (EQUAL Z (CAR V)))
(NOT (EQUAL (OCCURRENCES Z (CDR V)) 0))
(EQUAL (OCCURRENCES Z V) 0))
(NOT (MEMBER Z V))),
which simplifies, unfolding the function OCCURRENCES, to:
T.
Case 2. (IMPLIES (AND (LISTP V)
(NOT (EQUAL Z (CAR V)))
(NOT (MEMBER Z (CDR V)))
(EQUAL (OCCURRENCES Z V) 0))
(NOT (MEMBER Z V))),
which simplifies, expanding the definitions of OCCURRENCES and MEMBER, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP V))
(EQUAL (OCCURRENCES Z V) 0))
(NOT (MEMBER Z V))),
which simplifies, unfolding the functions OCCURRENCES, EQUAL, and MEMBER, to:
T.
That finishes the proof of *1.2.
So let us turn our attention to:
(IMPLIES (NOT (EQUAL (OCCURRENCES Z V) 0))
(MEMBER Z V)),
which is formula *1.1 above. Let us appeal to the induction principle. There
are two plausible inductions. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP V)
(EQUAL Z (CAR V))
(p Z (CDR V)))
(p Z V))
(IMPLIES (AND (LISTP V)
(NOT (EQUAL Z (CAR V)))
(p Z (CDR V)))
(p Z V))
(IMPLIES (NOT (LISTP V)) (p Z V))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT V)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme leads to five new conjectures:
Case 5. (IMPLIES (AND (LISTP V)
(EQUAL Z (CAR V))
(EQUAL (OCCURRENCES Z (CDR V)) 0)
(NOT (EQUAL (OCCURRENCES Z V) 0)))
(MEMBER Z V)),
which simplifies, opening up ADD1, OCCURRENCES, EQUAL, and MEMBER, to:
T.
Case 4. (IMPLIES (AND (LISTP V)
(EQUAL Z (CAR V))
(MEMBER Z (CDR V))
(NOT (EQUAL (OCCURRENCES Z V) 0)))
(MEMBER Z V)),
which simplifies, expanding the functions OCCURRENCES and MEMBER, to:
T.
Case 3. (IMPLIES (AND (LISTP V)
(NOT (EQUAL Z (CAR V)))
(EQUAL (OCCURRENCES Z (CDR V)) 0)
(NOT (EQUAL (OCCURRENCES Z V) 0)))
(MEMBER Z V)),
which simplifies, unfolding OCCURRENCES and EQUAL, to:
T.
Case 2. (IMPLIES (AND (LISTP V)
(NOT (EQUAL Z (CAR V)))
(MEMBER Z (CDR V))
(NOT (EQUAL (OCCURRENCES Z V) 0)))
(MEMBER Z V)),
which simplifies, expanding the functions OCCURRENCES and MEMBER, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP V))
(NOT (EQUAL (OCCURRENCES Z V) 0)))
(MEMBER Z V)),
which simplifies, opening up the functions OCCURRENCES and EQUAL, to:
T.
That finishes the proof of *1.1, which, in turn, finishes the proof of *1.
Q.E.D.
[ 0.0 0.0 0.3 ]
MEMBER-DELETE
(LEMMA MEMBER-DELETE-IMPLIES-MEMBERSHIP
(REWRITE)
(IMPLIES (MEMBER X (DELETE Y L))
(MEMBER X L))
((ENABLE DELETE)))
WARNING: Note that MEMBER-DELETE-IMPLIES-MEMBERSHIP contains the free
variable Y which will be chosen by instantiating the hypothesis
(MEMBER X (DELETE Y L)).
Give the conjecture the name *1.
Let us appeal to the induction principle. Two inductions are suggested
by terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP L) (EQUAL Y (CAR L)))
(p X L Y))
(IMPLIES (AND (LISTP L)
(NOT (EQUAL Y (CAR L)))
(p X (CDR L) Y))
(p X L Y))
(IMPLIES (NOT (LISTP L)) (p X L Y))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure (COUNT L)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme generates four new conjectures:
Case 4. (IMPLIES (AND (LISTP L)
(EQUAL Y (CAR L))
(MEMBER X (DELETE Y L)))
(MEMBER X L)),
which simplifies, expanding the functions DELETE and MEMBER, to:
T.
Case 3. (IMPLIES (AND (LISTP L)
(NOT (EQUAL Y (CAR L)))
(NOT (MEMBER X (DELETE Y (CDR L))))
(MEMBER X (DELETE Y L)))
(MEMBER X L)),
which simplifies, appealing to the lemmas CDR-CONS and CAR-CONS, and
expanding DELETE and MEMBER, to:
T.
Case 2. (IMPLIES (AND (LISTP L)
(NOT (EQUAL Y (CAR L)))
(MEMBER X (CDR L))
(MEMBER X (DELETE Y L)))
(MEMBER X L)),
which simplifies, rewriting with the lemmas CDR-CONS and CAR-CONS, and
opening up the functions DELETE and MEMBER, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP L))
(MEMBER X (DELETE Y L)))
(MEMBER X L)),
which simplifies, expanding DELETE and MEMBER, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
MEMBER-DELETE-IMPLIES-MEMBERSHIP
(LEMMA OCCURRENCES-DELETE
(REWRITE)
(EQUAL (OCCURRENCES X (DELETE Y L))
(IF (EQUAL X Y)
(IF (MEMBER X L)
(SUB1 (OCCURRENCES X L))
0)
(OCCURRENCES X L)))
((ENABLE OCCURRENCES DELETE EQUAL-OCCURRENCES-ZERO)))
This conjecture simplifies, clearly, to three new conjectures:
Case 3. (IMPLIES (NOT (EQUAL X Y))
(EQUAL (OCCURRENCES X (DELETE Y L))
(OCCURRENCES X L))),
which we will name *1.
Case 2. (IMPLIES (AND (EQUAL X Y) (MEMBER X L))
(EQUAL (OCCURRENCES X (DELETE Y L))
(SUB1 (OCCURRENCES X L)))).
This again simplifies, obviously, to:
(IMPLIES (MEMBER Y L)
(EQUAL (OCCURRENCES Y (DELETE Y L))
(SUB1 (OCCURRENCES Y L)))),
which we would normally push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us return to:
(EQUAL (OCCURRENCES X (DELETE Y L))
(IF (EQUAL X Y)
(IF (MEMBER X L)
(SUB1 (OCCURRENCES X L))
0)
(OCCURRENCES X L))),
named *1. Let us appeal to the induction principle. Four inductions are
suggested by terms in the conjecture. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP L) (EQUAL Y (CAR L)))
(p X Y L))
(IMPLIES (AND (LISTP L)
(NOT (EQUAL Y (CAR L)))
(p X Y (CDR L)))
(p X Y L))
(IMPLIES (NOT (LISTP L)) (p X Y L))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT L)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme produces three new conjectures:
Case 3. (IMPLIES (AND (LISTP L) (EQUAL Y (CAR L)))
(EQUAL (OCCURRENCES X (DELETE Y L))
(IF (EQUAL X Y)
(IF (MEMBER X L)
(SUB1 (OCCURRENCES X L))
0)
(OCCURRENCES X L)))),
which simplifies, applying SUB1-ADD1, and expanding the definitions of
DELETE, MEMBER, and OCCURRENCES, to:
T.
Case 2. (IMPLIES (AND (LISTP L)
(NOT (EQUAL Y (CAR L)))
(EQUAL (OCCURRENCES X (DELETE Y (CDR L)))
(IF (EQUAL X Y)
(IF (MEMBER X (CDR L))
(SUB1 (OCCURRENCES X (CDR L)))
0)
(OCCURRENCES X (CDR L)))))
(EQUAL (OCCURRENCES X (DELETE Y L))
(IF (EQUAL X Y)
(IF (MEMBER X L)
(SUB1 (OCCURRENCES X L))
0)
(OCCURRENCES X L)))).
This simplifies, applying CDR-CONS, CAR-CONS, and SUB1-ADD1, and expanding
the functions DELETE, OCCURRENCES, and MEMBER, to three new goals:
Case 2.3.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL Y (CAR L)))
(EQUAL X Y)
(MEMBER X (CDR L))
(EQUAL (OCCURRENCES X (DELETE Y (CDR L)))
(SUB1 (OCCURRENCES X (CDR L))))
(NOT (EQUAL X (CAR L))))
(EQUAL (OCCURRENCES X
(CONS (CAR L) (DELETE X (CDR L))))
(SUB1 (OCCURRENCES X (CDR L))))),
which again simplifies, applying CDR-CONS and CAR-CONS, and unfolding the
function OCCURRENCES, to:
T.
Case 2.2.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL Y (CAR L)))
(EQUAL X Y)
(MEMBER X (CDR L))
(EQUAL (OCCURRENCES X (DELETE Y (CDR L)))
(SUB1 (OCCURRENCES X (CDR L))))
(EQUAL X (CAR L)))
(EQUAL (OCCURRENCES X (CDR L))
(SUB1 (ADD1 (OCCURRENCES X (CDR L)))))).
This again simplifies, clearly, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP L)
(NOT (EQUAL Y (CAR L)))
(EQUAL X Y)
(NOT (MEMBER X (CDR L)))
(EQUAL (OCCURRENCES X (DELETE Y (CDR L)))
0)
(NOT (EQUAL X (CAR L))))
(EQUAL (OCCURRENCES X
(CONS (CAR L) (DELETE X (CDR L))))
0)).
This again simplifies, rewriting with EQUAL-OCCURRENCES-ZERO, CDR-CONS,
and CAR-CONS, and unfolding OCCURRENCES, to:
T.
Case 1. (IMPLIES (NOT (LISTP L))
(EQUAL (OCCURRENCES X (DELETE Y L))
(IF (EQUAL X Y)
(IF (MEMBER X L)
(SUB1 (OCCURRENCES X L))
0)
(OCCURRENCES X L)))).
This simplifies, unfolding DELETE, OCCURRENCES, MEMBER, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
OCCURRENCES-DELETE
(LEMMA MEMBER-BAGDIFF
(REWRITE)
(EQUAL (MEMBER X (BAGDIFF A B))
(LESSP (OCCURRENCES X B)
(OCCURRENCES X A)))
((ENABLE BAGDIFF OCCURRENCES EQUAL-OCCURRENCES-ZERO OCCURRENCES-DELETE)))
Call the conjecture *1.
We will try to prove it by induction. There are three plausible
inductions. They merge into two likely candidate inductions. However, only
one is unflawed. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP B)
(MEMBER (CAR B) A)
(p X (DELETE (CAR B) A) (CDR B)))
(p X A B))
(IMPLIES (AND (LISTP B)
(NOT (MEMBER (CAR B) A))
(p X A (CDR B)))
(p X A B))
(IMPLIES (NOT (LISTP B)) (p X A B))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT B)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instances chosen for A. The
above induction scheme generates three new goals:
Case 3. (IMPLIES (AND (LISTP B)
(MEMBER (CAR B) A)
(EQUAL (MEMBER X
(BAGDIFF (DELETE (CAR B) A) (CDR B)))
(LESSP (OCCURRENCES X (CDR B))
(OCCURRENCES X (DELETE (CAR B) A)))))
(EQUAL (MEMBER X (BAGDIFF A B))
(LESSP (OCCURRENCES X B)
(OCCURRENCES X A)))),
which simplifies, appealing to the lemmas OCCURRENCES-DELETE, SUB1-ADD1, and
EQUAL-OCCURRENCES-ZERO, and unfolding BAGDIFF, OCCURRENCES, and LESSP, to:
(IMPLIES (AND (LISTP B)
(MEMBER (CAR B) A)
(EQUAL X (CAR B))
(NOT (MEMBER X A))
(EQUAL (MEMBER X
(BAGDIFF (DELETE (CAR B) A) (CDR B)))
(LESSP (OCCURRENCES X (CDR B)) 0)))
(NOT (MEMBER X (BAGDIFF A (CDR B))))).
This again simplifies, clearly, to:
T.
Case 2. (IMPLIES (AND (LISTP B)
(NOT (MEMBER (CAR B) A))
(EQUAL (MEMBER X (BAGDIFF A (CDR B)))
(LESSP (OCCURRENCES X (CDR B))
(OCCURRENCES X A))))
(EQUAL (MEMBER X (BAGDIFF A B))
(LESSP (OCCURRENCES X B)
(OCCURRENCES X A)))).
This simplifies, expanding the functions BAGDIFF and OCCURRENCES, to the
following two new goals:
Case 2.2.
(IMPLIES (AND (LISTP B)
(NOT (MEMBER (CAR B) A))
(EQUAL (MEMBER X (BAGDIFF A (CDR B)))
(LESSP (OCCURRENCES X (CDR B))
(OCCURRENCES X A)))
(NOT (EQUAL X (CAR B))))
(EQUAL (MEMBER X (BAGDIFF A (CDR B)))
(LESSP (OCCURRENCES X (CDR B))
(OCCURRENCES X A)))).
This again simplifies, obviously, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP B)
(NOT (MEMBER (CAR B) A))
(EQUAL (MEMBER X (BAGDIFF A (CDR B)))
(LESSP (OCCURRENCES X (CDR B))
(OCCURRENCES X A)))
(EQUAL X (CAR B)))
(EQUAL (MEMBER X (BAGDIFF A (CDR B)))
(LESSP (ADD1 (OCCURRENCES X (CDR B)))
(OCCURRENCES X A)))).
But this again simplifies, appealing to the lemma EQUAL-OCCURRENCES-ZERO,
and unfolding the functions LESSP and EQUAL, to:
T.
Case 1. (IMPLIES (NOT (LISTP B))
(EQUAL (MEMBER X (BAGDIFF A B))
(LESSP (OCCURRENCES X B)
(OCCURRENCES X A)))),
which simplifies, rewriting with the lemma EQUAL-OCCURRENCES-ZERO, and
expanding the functions BAGDIFF, OCCURRENCES, EQUAL, and LESSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
MEMBER-BAGDIFF
(LEMMA BAGDIFF-DELETE
(REWRITE)
(EQUAL (BAGDIFF (DELETE E X) Y)
(DELETE E (BAGDIFF X Y)))
((ENABLE BAGDIFF DELETE DELETE-DELETE DELETE-NON-MEMBER MEMBER-BAGDIFF
MEMBER-DELETE OCCURRENCES-DELETE)))
Call the conjecture *1.
Perhaps we can prove it by induction. Three inductions are suggested by
terms in the conjecture. They merge into two likely candidate inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LISTP Y)
(MEMBER (CAR Y) (DELETE E X))
(p E X (CDR Y))
(p E (DELETE (CAR Y) X) (CDR Y)))
(p E X Y))
(IMPLIES (AND (LISTP Y)
(NOT (MEMBER (CAR Y) (DELETE E X)))
(p E X (CDR Y))
(p E (DELETE (CAR Y) X) (CDR Y)))
(p E X Y))
(IMPLIES (NOT (LISTP Y)) (p E X Y))).
Linear arithmetic and the lemma CDR-LESSP can be used to prove that the
measure (COUNT Y) decreases according to the well-founded relation LESSP in
each induction step of the scheme. Note, however, the inductive instances
chosen for X. The above induction scheme leads to three new goals:
Case 3. (IMPLIES (AND (LISTP Y)
(MEMBER (CAR Y) (DELETE E X))
(EQUAL (BAGDIFF (DELETE E X) (CDR Y))
(DELETE E (BAGDIFF X (CDR Y))))
(EQUAL (BAGDIFF (DELETE E (DELETE (CAR Y) X))
(CDR Y))
(DELETE E
(BAGDIFF (DELETE (CAR Y) X)
(CDR Y)))))
(EQUAL (BAGDIFF (DELETE E X) Y)
(DELETE E (BAGDIFF X Y)))),
which simplifies, applying the lemmas MEMBER-DELETE and DELETE-DELETE, and
opening up the definition of BAGDIFF, to:
T.
Case 2. (IMPLIES (AND (LISTP Y)
(NOT (MEMBER (CAR Y) (DELETE E X)))
(EQUAL (BAGDIFF (DELETE E X) (CDR Y))
(DELETE E (BAGDIFF X (CDR Y))))
(EQUAL (BAGDIFF (DELETE E (DELETE (CAR Y) X))
(CDR Y))
(DELETE E
(BAGDIFF (DELETE (CAR Y) X)
(CDR Y)))))
(EQUAL (BAGDIFF (DELETE E X) Y)
(DELETE E (BAGDIFF X Y)))),
which simplifies, rewriting with MEMBER-DELETE, and opening up the function
BAGDIFF, to the following two new goals:
Case 2.2.
(IMPLIES (AND (LISTP Y)
(EQUAL (CAR Y) E)
(NOT (LESSP 1 (OCCURRENCES E X)))
(EQUAL (BAGDIFF (DELETE E X) (CDR Y))
(DELETE E (BAGDIFF X (CDR Y))))
(EQUAL (BAGDIFF (DELETE E (DELETE (CAR Y) X))
(CDR Y))
(DELETE E
(BAGDIFF (DELETE (CAR Y) X) (CDR Y))))
(NOT (MEMBER E X)))
(EQUAL (BAGDIFF (DELETE E X) (CDR Y))
(DELETE E (BAGDIFF X (CDR Y))))).
This again simplifies, trivially, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP Y)
(EQUAL (CAR Y) E)
(NOT (LESSP 1 (OCCURRENCES E X)))
(EQUAL (BAGDIFF (DELETE E X) (CDR Y))
(DELETE E (BAGDIFF X (CDR Y))))
(EQUAL (BAGDIFF (DELETE E (DELETE (CAR Y) X))
(CDR Y))
(DELETE E
(BAGDIFF (DELETE (CAR Y) X) (CDR Y))))
(MEMBER E X))
(EQUAL (BAGDIFF (DELETE E X) (CDR Y))
(DELETE E
(BAGDIFF (DELETE (CAR Y) X)
(CDR Y))))).
But this again simplifies, using linear arithmetic, applying MEMBER-DELETE,
DELETE-NON-MEMBER, MEMBER-BAGDIFF, and OCCURRENCES-DELETE, and opening up
the function SUB1, to:
T.
Case 1. (IMPLIES (NOT (LISTP Y))
(EQUAL (BAGDIFF (DELETE E X) Y)
(DELETE E (BAGDIFF X Y)))).
This simplifies, unfolding the definition of BAGDIFF, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
BAGDIFF-DELETE
(LEMMA SUBBAGP-DELETE
(REWRITE)
(IMPLIES (SUBBAGP X (DELETE U Y))
(SUBBAGP X Y))
((ENABLE DELETE SUBBAGP DELETE-DELETE MEMBER-DELETE-IMPLIES-MEMBERSHIP)))
WARNING: Note that SUBBAGP-DELETE contains the free variable U which will be
chosen by instantiating the hypothesis (SUBBAGP X (DELETE U Y)).
Give the conjecture the name *1.
Let us appeal to the induction principle. Three inductions are suggested
by terms in the conjecture. They merge into two likely candidate inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) (DELETE U Y))
(p (CDR X) (DELETE (CAR X) Y) U))
(p X Y U))
(IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) (DELETE U Y))))
(p X Y U))
(IMPLIES (NOT (LISTP X)) (p X Y U))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instance chosen for Y. The above
induction scheme generates four new conjectures:
Case 4. (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) (DELETE U Y))
(NOT (SUBBAGP (CDR X)
(DELETE U (DELETE (CAR X) Y))))
(SUBBAGP X (DELETE U Y)))
(SUBBAGP X Y)),
which simplifies, applying DELETE-DELETE, and opening up SUBBAGP, to:
T.
Case 3. (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) (DELETE U Y))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(SUBBAGP X (DELETE U Y)))
(SUBBAGP X Y)).
This simplifies, applying the lemmas DELETE-DELETE and
MEMBER-DELETE-IMPLIES-MEMBERSHIP, and unfolding the function SUBBAGP, to:
T.
Case 2. (IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) (DELETE U Y)))
(SUBBAGP X (DELETE U Y)))
(SUBBAGP X Y)).
This simplifies, unfolding the function SUBBAGP, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP X))
(SUBBAGP X (DELETE U Y)))
(SUBBAGP X Y)).
This simplifies, unfolding the definition of SUBBAGP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
SUBBAGP-DELETE
(LEMMA SUBBAGP-CDR1
(REWRITE)
(IMPLIES (SUBBAGP X Y)
(SUBBAGP (CDR X) Y))
((ENABLE SUBBAGP SUBBAGP-DELETE)))
.
Applying the lemma CAR-CDR-ELIM, replace X by (CONS V Z) to eliminate (CDR X)
and (CAR X). We thus obtain the following two new goals:
Case 2. (IMPLIES (AND (NOT (LISTP X)) (SUBBAGP X Y))
(SUBBAGP (CDR X) Y)).
But this simplifies, applying CDR-NLISTP, and expanding SUBBAGP and LISTP,
to:
T.
Case 1. (IMPLIES (SUBBAGP (CONS V Z) Y)
(SUBBAGP Z Y)).
However this simplifies, rewriting with CDR-CONS, CAR-CONS, and
SUBBAGP-DELETE, and expanding the definition of SUBBAGP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
SUBBAGP-CDR1
(LEMMA SUBBAGP-CDR2
(REWRITE)
(IMPLIES (SUBBAGP X (CDR Y))
(SUBBAGP X Y))
((ENABLE DELETE SUBBAGP DELETE-NON-MEMBER SUBBAGP-CDR1)))
.
Applying the lemma CAR-CDR-ELIM, replace Y by (CONS V Z) to eliminate (CDR Y)
and (CAR Y). We thus obtain the following two new goals:
Case 2. (IMPLIES (AND (NOT (LISTP Y))
(SUBBAGP X (CDR Y)))
(SUBBAGP X Y)).
But this simplifies, applying CDR-NLISTP, and expanding MEMBER, LISTP, and
SUBBAGP, to:
T.
Case 1. (IMPLIES (SUBBAGP X Z)
(SUBBAGP X (CONS V Z))),
which we would usually push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us consider:
(IMPLIES (SUBBAGP X (CDR Y))
(SUBBAGP X Y)),
which we named *1 above. We will appeal to induction. Two inductions are
suggested by terms in the conjecture. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) (CDR Y))
(p (CDR X) (DELETE (CAR X) Y)))
(p X Y))
(IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) (CDR Y))))
(p X Y))
(IMPLIES (NOT (LISTP X)) (p X Y))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instance chosen for Y. The above
induction scheme leads to the following four new conjectures:
Case 4. (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) (CDR Y))
(NOT (SUBBAGP (CDR X)
(CDR (DELETE (CAR X) Y))))
(SUBBAGP X (CDR Y)))
(SUBBAGP X Y)).
This simplifies, unfolding SUBBAGP and MEMBER, to the following two new
conjectures:
Case 4.2.
(IMPLIES (AND (LISTP X)
(MEMBER (CAR X) (CDR Y))
(NOT (SUBBAGP (CDR X)
(CDR (DELETE (CAR X) Y))))
(SUBBAGP (CDR X)
(DELETE (CAR X) (CDR Y))))
(LISTP Y)).
But this again simplifies, rewriting with CDR-NLISTP, and opening up LISTP
and MEMBER, to:
T.
Case 4.1.
(IMPLIES (AND (LISTP X)
(MEMBER (CAR X) (CDR Y))
(NOT (SUBBAGP (CDR X)
(CDR (DELETE (CAR X) Y))))
(SUBBAGP (CDR X)
(DELETE (CAR X) (CDR Y))))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))).
This further simplifies, rewriting with CDR-NLISTP, DELETE-NON-MEMBER, and
SUBBAGP-CDR1, and unfolding the definitions of DELETE, MEMBER, LISTP, and
SUBBAGP, to the new formula:
(IMPLIES (AND (LISTP X)
(MEMBER (CAR X) (CDR Y))
(LISTP Y)
(NOT (EQUAL (CAR X) (CAR Y)))
(NOT (SUBBAGP (CDR X)
(CDR (CONS (CAR Y)
(DELETE (CAR X) (CDR Y))))))
(SUBBAGP (CDR X)
(DELETE (CAR X) (CDR Y))))
(SUBBAGP (CDR X)
(CONS (CAR Y)
(DELETE (CAR X) (CDR Y))))),
which again simplifies, rewriting with CDR-CONS, to:
T.
Case 3. (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) (CDR Y))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(SUBBAGP X (CDR Y)))
(SUBBAGP X Y)).
This simplifies, unfolding the definitions of SUBBAGP and MEMBER, to:
(IMPLIES (AND (LISTP X)
(MEMBER (CAR X) (CDR Y))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(SUBBAGP (CDR X)
(DELETE (CAR X) (CDR Y))))
(LISTP Y)),
which again simplifies, applying CDR-NLISTP, and opening up the functions
LISTP and MEMBER, to:
T.
Case 2. (IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) (CDR Y)))
(SUBBAGP X (CDR Y)))
(SUBBAGP X Y)).
This simplifies, unfolding the definition of SUBBAGP, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP X))
(SUBBAGP X (CDR Y)))
(SUBBAGP X Y)).
This simplifies, unfolding the function SUBBAGP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
SUBBAGP-CDR2
(LEMMA SUBBAGP-BAGINT1
(REWRITE)
(SUBBAGP (BAGINT X Y) X)
((ENABLE DELETE SUBBAGP BAGINT SUBBAGP-CDR2)))
Give the conjecture the name *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(p (CDR X) (DELETE (CAR X) Y)))
(p X Y))
(IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) Y))
(p (CDR X) Y))
(p X Y))
(IMPLIES (NOT (LISTP X)) (p X Y))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instances chosen for Y. The
above induction scheme leads to three new formulas:
Case 3. (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(SUBBAGP (BAGINT (CDR X) (DELETE (CAR X) Y))
(CDR X)))
(SUBBAGP (BAGINT X Y) X)),
which simplifies, applying CDR-CONS and CAR-CONS, and opening up the
definitions of BAGINT, DELETE, MEMBER, and SUBBAGP, to:
T.
Case 2. (IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) Y))
(SUBBAGP (BAGINT (CDR X) Y) (CDR X)))
(SUBBAGP (BAGINT X Y) X)).
This simplifies, applying SUBBAGP-CDR2, and unfolding BAGINT, to:
T.
Case 1. (IMPLIES (NOT (LISTP X))
(SUBBAGP (BAGINT X Y) X)),
which simplifies, appealing to the lemmas SUBBAGP-CDR2 and CDR-NLISTP, and
unfolding BAGINT, CDR, LISTP, and SUBBAGP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
SUBBAGP-BAGINT1
(LEMMA SUBBAGP-BAGINT2
(REWRITE)
(SUBBAGP (BAGINT X Y) Y)
((ENABLE SUBBAGP BAGINT SUBBAGP-CDR2)))
Give the conjecture the name *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(p (CDR X) (DELETE (CAR X) Y)))
(p X Y))
(IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) Y))
(p (CDR X) Y))
(p X Y))
(IMPLIES (NOT (LISTP X)) (p X Y))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instances chosen for Y. The
above induction scheme leads to three new formulas:
Case 3. (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(SUBBAGP (BAGINT (CDR X) (DELETE (CAR X) Y))
(DELETE (CAR X) Y)))
(SUBBAGP (BAGINT X Y) Y)),
which simplifies, applying CDR-CONS and CAR-CONS, and opening up the
definitions of BAGINT and SUBBAGP, to:
T.
Case 2. (IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) Y))
(SUBBAGP (BAGINT (CDR X) Y) Y))
(SUBBAGP (BAGINT X Y) Y)).
This simplifies, expanding BAGINT, to:
T.
Case 1. (IMPLIES (NOT (LISTP X))
(SUBBAGP (BAGINT X Y) Y)).
This simplifies, applying SUBBAGP-CDR2, and opening up the functions BAGINT,
SUBBAGP, and LISTP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
SUBBAGP-BAGINT2
(PROVE-LEMMA OCCURRENCES-BAGINT
(REWRITE)
(EQUAL (OCCURRENCES X (BAGINT A B))
(IF (LESSP (OCCURRENCES X A)
(OCCURRENCES X B))
(OCCURRENCES X A)
(OCCURRENCES X B)))
((ENABLE OCCURRENCES BAGINT EQUAL-OCCURRENCES-ZERO
OCCURRENCES-DELETE)))
This formula simplifies, obviously, to the following two new conjectures:
Case 2. (IMPLIES (NOT (LESSP (OCCURRENCES X A)
(OCCURRENCES X B)))
(EQUAL (OCCURRENCES X (BAGINT A B))
(OCCURRENCES X B))).
Call the above conjecture *1.
Case 1. (IMPLIES (LESSP (OCCURRENCES X A)
(OCCURRENCES X B))
(EQUAL (OCCURRENCES X (BAGINT A B))
(OCCURRENCES X A))),
which we would usually push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us consider:
(EQUAL (OCCURRENCES X (BAGINT A B))
(IF (LESSP (OCCURRENCES X A)
(OCCURRENCES X B))
(OCCURRENCES X A)
(OCCURRENCES X B))).
We gave this the name *1 above. Perhaps we can prove it by induction. The
recursive terms in the conjecture suggest five inductions. They merge into
two likely candidate inductions. However, only one is unflawed. We will
induct according to the following scheme:
(AND (IMPLIES (AND (LISTP A)
(MEMBER (CAR A) B)
(p X (CDR A) (DELETE (CAR A) B)))
(p X A B))
(IMPLIES (AND (LISTP A)
(NOT (MEMBER (CAR A) B))
(p X (CDR A) B))
(p X A B))
(IMPLIES (NOT (LISTP A)) (p X A B))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT A)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instances chosen for B. The
above induction scheme leads to the following three new goals:
Case 3. (IMPLIES (AND (LISTP A)
(MEMBER (CAR A) B)
(EQUAL (OCCURRENCES X
(BAGINT (CDR A) (DELETE (CAR A) B)))
(IF (LESSP (OCCURRENCES X (CDR A))
(OCCURRENCES X (DELETE (CAR A) B)))
(OCCURRENCES X (CDR A))
(OCCURRENCES X (DELETE (CAR A) B)))))
(EQUAL (OCCURRENCES X (BAGINT A B))
(IF (LESSP (OCCURRENCES X A)
(OCCURRENCES X B))
(OCCURRENCES X A)
(OCCURRENCES X B)))).
This simplifies, applying OCCURRENCES-DELETE, EQUAL-OCCURRENCES-ZERO,
CDR-CONS, CAR-CONS, SUB1-ADD1, and ADD1-SUB1, and opening up the definitions
of BAGINT, OCCURRENCES, and LESSP, to two new goals:
Case 3.2.
(IMPLIES
(AND (LISTP A)
(MEMBER (CAR A) B)
(EQUAL X (CAR A))
(NOT (MEMBER X B))
(NOT (LESSP (OCCURRENCES X (CDR A)) 0))
(EQUAL (OCCURRENCES X
(BAGINT (CDR A) (DELETE (CAR A) B)))
0))
(EQUAL (OCCURRENCES X (BAGINT (CDR A) B))
(OCCURRENCES X B))),
which again simplifies, trivially, to:
T.
Case 3.1.
(IMPLIES
(AND (LISTP A)
(MEMBER (CAR A) B)
(EQUAL X (CAR A))
(NOT (MEMBER X B))
(LESSP (OCCURRENCES X (CDR A)) 0)
(EQUAL (OCCURRENCES X
(BAGINT (CDR A) (DELETE (CAR A) B)))
(OCCURRENCES X (CDR A))))
(EQUAL (OCCURRENCES X (BAGINT (CDR A) B))
(OCCURRENCES X B))).
This again simplifies, trivially, to:
T.
Case 2. (IMPLIES (AND (LISTP A)
(NOT (MEMBER (CAR A) B))
(EQUAL (OCCURRENCES X (BAGINT (CDR A) B))
(IF (LESSP (OCCURRENCES X (CDR A))
(OCCURRENCES X B))
(OCCURRENCES X (CDR A))
(OCCURRENCES X B))))
(EQUAL (OCCURRENCES X (BAGINT A B))
(IF (LESSP (OCCURRENCES X A)
(OCCURRENCES X B))
(OCCURRENCES X A)
(OCCURRENCES X B)))).
This simplifies, expanding the functions BAGINT and OCCURRENCES, to the
following three new conjectures:
Case 2.3.
(IMPLIES (AND (LISTP A)
(NOT (MEMBER (CAR A) B))
(NOT (LESSP (OCCURRENCES X (CDR A))
(OCCURRENCES X B)))
(EQUAL (OCCURRENCES X (BAGINT (CDR A) B))
(OCCURRENCES X B))
(EQUAL X (CAR A))
(LESSP (ADD1 (OCCURRENCES X (CDR A)))
(OCCURRENCES X B)))
(EQUAL (OCCURRENCES X B)
(ADD1 (OCCURRENCES X (CDR A))))).
But this again simplifies, using linear arithmetic, to:
T.
Case 2.2.
(IMPLIES (AND (LISTP A)
(NOT (MEMBER (CAR A) B))
(LESSP (OCCURRENCES X (CDR A))
(OCCURRENCES X B))
(EQUAL (OCCURRENCES X (BAGINT (CDR A) B))
(OCCURRENCES X (CDR A)))
(EQUAL X (CAR A))
(NOT (LESSP (ADD1 (OCCURRENCES X (CDR A)))
(OCCURRENCES X B))))
(EQUAL (OCCURRENCES X (CDR A))
(OCCURRENCES X B))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (EQUAL (OCCURRENCES (CAR A) B)
(PLUS 1
(OCCURRENCES (CAR A) (CDR A))))
(LISTP A)
(NOT (MEMBER (CAR A) B))
(LESSP (OCCURRENCES (CAR A) (CDR A))
(PLUS 1
(OCCURRENCES (CAR A) (CDR A))))
(EQUAL (OCCURRENCES (CAR A)
(BAGINT (CDR A) B))
(OCCURRENCES (CAR A) (CDR A)))
(NOT (LESSP (ADD1 (OCCURRENCES (CAR A) (CDR A)))
(PLUS 1
(OCCURRENCES (CAR A) (CDR A))))))
(EQUAL (OCCURRENCES (CAR A) (CDR A))
(PLUS 1
(OCCURRENCES (CAR A) (CDR A))))).
But this again simplifies, rewriting with EQUAL-OCCURRENCES-ZERO, and
unfolding the definition of LESSP, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP A)
(NOT (MEMBER (CAR A) B))
(LESSP (OCCURRENCES X (CDR A))
(OCCURRENCES X B))
(EQUAL (OCCURRENCES X (BAGINT (CDR A) B))
(OCCURRENCES X (CDR A)))
(EQUAL X (CAR A))
(LESSP (ADD1 (OCCURRENCES X (CDR A)))
(OCCURRENCES X B)))
(EQUAL (OCCURRENCES X (CDR A))
(ADD1 (OCCURRENCES X (CDR A))))).
However this again simplifies, rewriting with EQUAL-OCCURRENCES-ZERO, and
opening up LESSP, to:
T.
Case 1. (IMPLIES (NOT (LISTP A))
(EQUAL (OCCURRENCES X (BAGINT A B))
(IF (LESSP (OCCURRENCES X A)
(OCCURRENCES X B))
(OCCURRENCES X A)
(OCCURRENCES X B)))).
This simplifies, appealing to the lemma EQUAL-OCCURRENCES-ZERO, and
expanding BAGINT, LISTP, OCCURRENCES, EQUAL, and LESSP, to:
(IMPLIES (AND (NOT (LISTP A))
(NOT (MEMBER X B)))
(EQUAL 0 (OCCURRENCES X B))),
which again simplifies, rewriting with EQUAL-OCCURRENCES-ZERO, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
OCCURRENCES-BAGINT
(PROVE-LEMMA OCCURRENCES-BAGDIFF
(REWRITE)
(EQUAL (OCCURRENCES X (BAGDIFF A B))
(DIFFERENCE (OCCURRENCES X A)
(OCCURRENCES X B)))
((ENABLE OCCURRENCES BAGDIFF EQUAL-OCCURRENCES-ZERO
OCCURRENCES-DELETE)))
Call the conjecture *1.
We will try to prove it by induction. There are three plausible
inductions. They merge into two likely candidate inductions. However, only
one is unflawed. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP B)
(MEMBER (CAR B) A)
(p X (DELETE (CAR B) A) (CDR B)))
(p X A B))
(IMPLIES (AND (LISTP B)
(NOT (MEMBER (CAR B) A))
(p X A (CDR B)))
(p X A B))
(IMPLIES (NOT (LISTP B)) (p X A B))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT B)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instances chosen for A. The
above induction scheme generates three new goals:
Case 3. (IMPLIES (AND (LISTP B)
(MEMBER (CAR B) A)
(EQUAL (OCCURRENCES X
(BAGDIFF (DELETE (CAR B) A) (CDR B)))
(DIFFERENCE (OCCURRENCES X (DELETE (CAR B) A))
(OCCURRENCES X (CDR B)))))
(EQUAL (OCCURRENCES X (BAGDIFF A B))
(DIFFERENCE (OCCURRENCES X A)
(OCCURRENCES X B)))),
which simplifies, appealing to the lemmas OCCURRENCES-DELETE, SUB1-ADD1,
EQUAL-OCCURRENCES-ZERO, and MEMBER-BAGDIFF, and unfolding BAGDIFF,
OCCURRENCES, DIFFERENCE, and LESSP, to:
T.
Case 2. (IMPLIES (AND (LISTP B)
(NOT (MEMBER (CAR B) A))
(EQUAL (OCCURRENCES X (BAGDIFF A (CDR B)))
(DIFFERENCE (OCCURRENCES X A)
(OCCURRENCES X (CDR B)))))
(EQUAL (OCCURRENCES X (BAGDIFF A B))
(DIFFERENCE (OCCURRENCES X A)
(OCCURRENCES X B)))),
which simplifies, opening up BAGDIFF and OCCURRENCES, to two new goals:
Case 2.2.
(IMPLIES (AND (LISTP B)
(NOT (MEMBER (CAR B) A))
(EQUAL (OCCURRENCES X (BAGDIFF A (CDR B)))
(DIFFERENCE (OCCURRENCES X A)
(OCCURRENCES X (CDR B))))
(NOT (EQUAL X (CAR B))))
(EQUAL (OCCURRENCES X (BAGDIFF A (CDR B)))
(DIFFERENCE (OCCURRENCES X A)
(OCCURRENCES X (CDR B))))),
which again simplifies, trivially, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP B)
(NOT (MEMBER (CAR B) A))
(EQUAL (OCCURRENCES X (BAGDIFF A (CDR B)))
(DIFFERENCE (OCCURRENCES X A)
(OCCURRENCES X (CDR B))))
(EQUAL X (CAR B)))
(EQUAL (OCCURRENCES X (BAGDIFF A (CDR B)))
(DIFFERENCE (OCCURRENCES X A)
(ADD1 (OCCURRENCES X (CDR B)))))).
But this again simplifies, applying EQUAL-OCCURRENCES-ZERO and
MEMBER-BAGDIFF, and unfolding DIFFERENCE and LESSP, to:
T.
Case 1. (IMPLIES (NOT (LISTP B))
(EQUAL (OCCURRENCES X (BAGDIFF A B))
(DIFFERENCE (OCCURRENCES X A)
(OCCURRENCES X B)))).
This simplifies, applying EQUAL-OCCURRENCES-ZERO, and opening up the
functions BAGDIFF, OCCURRENCES, EQUAL, and DIFFERENCE, to:
(IMPLIES (AND (NOT (LISTP B))
(NOT (MEMBER X A)))
(EQUAL (OCCURRENCES X A) 0)).
But this again simplifies, rewriting with the lemma EQUAL-OCCURRENCES-ZERO,
to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
OCCURRENCES-BAGDIFF
(PROVE-LEMMA MEMBER-BAGINT
(REWRITE)
(EQUAL (MEMBER X (BAGINT A B))
(AND (MEMBER X A) (MEMBER X B)))
((ENABLE BAGINT MEMBER-DELETE)))
This simplifies, opening up the function AND, to two new conjectures:
Case 2. (IMPLIES (NOT (MEMBER X A))
(EQUAL (MEMBER X (BAGINT A B)) F)),
which again simplifies, clearly, to:
(IMPLIES (NOT (MEMBER X A))
(NOT (MEMBER X (BAGINT A B)))),
which we will name *1.
Case 1. (IMPLIES (MEMBER X A)
(EQUAL (MEMBER X (BAGINT A B))
(MEMBER X B))),
which we would usually push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us consider:
(EQUAL (MEMBER X (BAGINT A B))
(AND (MEMBER X A) (MEMBER X B))),
which we named *1 above. We will appeal to induction. There are three
plausible inductions. They merge into two likely candidate inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LISTP A)
(MEMBER (CAR A) B)
(p X (CDR A) (DELETE (CAR A) B)))
(p X A B))
(IMPLIES (AND (LISTP A)
(NOT (MEMBER (CAR A) B))
(p X (CDR A) B))
(p X A B))
(IMPLIES (NOT (LISTP A)) (p X A B))).
Linear arithmetic and the lemma CDR-LESSP can be used to show that the measure
(COUNT A) decreases according to the well-founded relation LESSP in each
induction step of the scheme. Note, however, the inductive instances chosen
for B. The above induction scheme produces three new conjectures:
Case 3. (IMPLIES (AND (LISTP A)
(MEMBER (CAR A) B)
(EQUAL (MEMBER X
(BAGINT (CDR A) (DELETE (CAR A) B)))
(AND (MEMBER X (CDR A))
(MEMBER X (DELETE (CAR A) B)))))
(EQUAL (MEMBER X (BAGINT A B))
(AND (MEMBER X A) (MEMBER X B)))),
which simplifies, applying the lemmas MEMBER-DELETE, CDR-CONS, and CAR-CONS,
and expanding AND, BAGINT, MEMBER, and EQUAL, to two new goals:
Case 3.2.
(IMPLIES (AND (LISTP A)
(MEMBER (CAR A) B)
(NOT (MEMBER X B))
(EQUAL (MEMBER X
(BAGINT (CDR A) (DELETE (CAR A) B)))
F))
(NOT (EQUAL X (CAR A)))),
which again simplifies, trivially, to:
T.
Case 3.1.
(IMPLIES (AND (LISTP A)
(MEMBER (CAR A) B)
(NOT (MEMBER X (CDR A)))
(EQUAL (MEMBER X
(BAGINT (CDR A) (DELETE (CAR A) B)))
F)
(EQUAL X (CAR A)))
(EQUAL (MEMBER X B) T)).
This again simplifies, trivially, to:
T.
Case 2. (IMPLIES (AND (LISTP A)
(NOT (MEMBER (CAR A) B))
(EQUAL (MEMBER X (BAGINT (CDR A) B))
(AND (MEMBER X (CDR A))
(MEMBER X B))))
(EQUAL (MEMBER X (BAGINT A B))
(AND (MEMBER X A) (MEMBER X B)))).
This simplifies, unfolding the definitions of AND, BAGINT, and MEMBER, to
the new conjecture:
(IMPLIES (AND (LISTP A)
(NOT (MEMBER (CAR A) B))
(NOT (MEMBER X (CDR A)))
(EQUAL (MEMBER X (BAGINT (CDR A) B))
F)
(EQUAL X (CAR A)))
(NOT (MEMBER X B))),
which again simplifies, clearly, to:
T.
Case 1. (IMPLIES (NOT (LISTP A))
(EQUAL (MEMBER X (BAGINT A B))
(AND (MEMBER X A) (MEMBER X B)))).
This simplifies, rewriting with MEMBER-NON-LIST, and expanding the
definitions of BAGINT, AND, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
MEMBER-BAGINT
(DEFTHEORY BAGS
(OCCURRENCES-BAGINT BAGDIFF-DELETE OCCURRENCES-BAGDIFF
MEMBER-BAGINT MEMBER-BAGDIFF SUBBAGP-BAGINT2
SUBBAGP-BAGINT1 SUBBAGP-CDR2 SUBBAGP-CDR1
SUBBAGP-DELETE))
[ 0.0 0.0 0.0 ]
BAGS
(LEMMA EQUAL-PLUS-0
(REWRITE)
(EQUAL (EQUAL (PLUS A B) 0)
(AND (ZEROP A) (ZEROP B))))
This simplifies, opening up the functions ZEROP and AND, to six new
conjectures:
Case 6. (IMPLIES (AND (NOT (EQUAL (PLUS A B) 0))
(NOT (NUMBERP A)))
(NOT (EQUAL B 0))),
which again simplifies, expanding NUMBERP, PLUS, and EQUAL, to:
T.
Case 5. (IMPLIES (AND (NOT (EQUAL (PLUS A B) 0))
(NOT (NUMBERP A)))
(NUMBERP B)),
which again simplifies, unfolding PLUS and EQUAL, to:
T.
Case 4. (IMPLIES (AND (NOT (EQUAL (PLUS A B) 0))
(EQUAL A 0))
(NOT (EQUAL B 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL (PLUS A B) 0))
(EQUAL A 0))
(NUMBERP B)),
which again simplifies, expanding the functions EQUAL and PLUS, to:
T.
Case 2. (IMPLIES (AND (EQUAL (PLUS A B) 0)
(NOT (EQUAL A 0)))
(NOT (NUMBERP A))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (EQUAL (PLUS A B) 0)
(NOT (EQUAL B 0)))
(NOT (NUMBERP B))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-PLUS-0
(LEMMA PLUS-CANCELLATION
(REWRITE)
(EQUAL (EQUAL (PLUS A B) (PLUS A C))
(EQUAL (FIX B) (FIX C))))
This conjecture simplifies, expanding the definition of FIX, to the following
seven new formulas:
Case 7. (IMPLIES (AND (NUMBERP C)
(NUMBERP B)
(NOT (EQUAL B C)))
(NOT (EQUAL (PLUS A B) (PLUS A C)))).
This again simplifies, using linear arithmetic, to:
T.
Case 6. (IMPLIES (AND (NUMBERP C)
(NOT (NUMBERP B))
(NOT (EQUAL 0 C)))
(NOT (EQUAL (PLUS A B) (PLUS A C)))),
which we will name *1.
Case 5. (IMPLIES (AND (NOT (NUMBERP C))
(NUMBERP B)
(NOT (EQUAL B 0)))
(NOT (EQUAL (PLUS A B) (PLUS A C)))),
which we would usually push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us consider:
(EQUAL (EQUAL (PLUS A B) (PLUS A C))
(EQUAL (FIX B) (FIX C))).
We gave this the name *1 above. Perhaps we can prove it by induction. Two
inductions are suggested by terms in the conjecture. However, they merge into
one likely candidate induction. We will induct according to the following
scheme:
(AND (IMPLIES (ZEROP A) (p A B C))
(IMPLIES (AND (NOT (ZEROP A)) (p (SUB1 A) B C))
(p A B C))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definition
of ZEROP inform us that the measure (COUNT A) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme produces the following two new formulas:
Case 2. (IMPLIES (ZEROP A)
(EQUAL (EQUAL (PLUS A B) (PLUS A C))
(EQUAL (FIX B) (FIX C)))).
This simplifies, expanding the functions ZEROP, EQUAL, PLUS, and FIX, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP A))
(EQUAL (EQUAL (PLUS (SUB1 A) B)
(PLUS (SUB1 A) C))
(EQUAL (FIX B) (FIX C))))
(EQUAL (EQUAL (PLUS A B) (PLUS A C))
(EQUAL (FIX B) (FIX C)))).
This simplifies, rewriting with ADD1-EQUAL, and unfolding the definitions of
ZEROP, FIX, PLUS, and EQUAL, to two new goals:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP C))
(EQUAL B 0)
(EQUAL (EQUAL (PLUS (SUB1 A) B)
(PLUS (SUB1 A) C))
T))
(EQUAL (PLUS A 0)
(ADD1 (PLUS (SUB1 A) C)))),
which again simplifies, trivially, to:
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP C))
(EQUAL (PLUS (SUB1 A) 0)
(PLUS (SUB1 A) C)))
(EQUAL (PLUS A 0)
(ADD1 (PLUS (SUB1 A) 0)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP B))
(EQUAL 0 C)
(EQUAL (EQUAL (PLUS (SUB1 A) B)
(PLUS (SUB1 A) C))
T))
(EQUAL (ADD1 (PLUS (SUB1 A) B))
(PLUS A 0))),
which again simplifies, trivially, to the new formula:
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP B))
(EQUAL (PLUS (SUB1 A) B)
(PLUS (SUB1 A) 0)))
(EQUAL (ADD1 (PLUS (SUB1 A) 0))
(PLUS A 0))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
PLUS-CANCELLATION
(DISABLE PLUS-CANCELLATION)
[ 0.0 0.0 0.0 ]
PLUS-CANCELLATION-OFF
(LEMMA EQUAL-DIFFERENCE-0
(REWRITE)
(AND (EQUAL (EQUAL (DIFFERENCE X Y) 0)
(NOT (LESSP Y X)))
(EQUAL (EQUAL 0 (DIFFERENCE X Y))
(NOT (LESSP Y X))))
((INDUCT (DIFFERENCE X Y))))
WARNING: Note that the proposed lemma EQUAL-DIFFERENCE-0 is to be stored as
zero type prescription rules, zero compound recognizer rules, zero linear
rules, and two replacement rules.
This conjecture can be simplified, using the abbreviations ZEROP, NOT, OR, and
AND, to three new conjectures:
Case 3. (IMPLIES (ZEROP X)
(AND (EQUAL (EQUAL (DIFFERENCE X Y) 0)
(NOT (LESSP Y X)))
(EQUAL (EQUAL 0 (DIFFERENCE X Y))
(NOT (LESSP Y X))))),
which simplifies, expanding the definitions of ZEROP, EQUAL, DIFFERENCE,
LESSP, NOT, and AND, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(ZEROP Y))
(AND (EQUAL (EQUAL (DIFFERENCE X Y) 0)
(NOT (LESSP Y X)))
(EQUAL (EQUAL 0 (DIFFERENCE X Y))
(NOT (LESSP Y X))))),
which simplifies, unfolding the definitions of ZEROP, EQUAL, DIFFERENCE,
LESSP, NOT, and AND, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(EQUAL (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)
(NOT (LESSP (SUB1 Y) (SUB1 X))))
(EQUAL (EQUAL 0
(DIFFERENCE (SUB1 X) (SUB1 Y)))
(NOT (LESSP (SUB1 Y) (SUB1 X)))))
(AND (EQUAL (EQUAL (DIFFERENCE X Y) 0)
(NOT (LESSP Y X)))
(EQUAL (EQUAL 0 (DIFFERENCE X Y))
(NOT (LESSP Y X))))),
which simplifies, expanding the functions NOT, EQUAL, DIFFERENCE, LESSP, and
AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-DIFFERENCE-0
(LEMMA DIFFERENCE-CANCELLATION
(REWRITE)
(EQUAL (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y))
(IF (LESSP X Y)
(NOT (LESSP Y Z))
(IF (LESSP Z Y)
(NOT (LESSP Y X))
(EQUAL (FIX X) (FIX Z)))))
((ENABLE EQUAL-DIFFERENCE-0)))
This simplifies, opening up NOT and FIX, to the following 11 new goals:
Case 11.(IMPLIES (AND (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y))
(NOT (LESSP X Y))
(NOT (LESSP Z Y))
(NOT (NUMBERP Z))
(NUMBERP X))
(EQUAL (EQUAL X 0) T)).
This again simplifies, applying EQUAL-DIFFERENCE-0, and expanding DIFFERENCE
and LESSP, to the following two new conjectures:
Case 11.2.
(IMPLIES (AND (NOT (LESSP Y X))
(NOT (LESSP X Y))
(EQUAL Y 0)
(NOT (NUMBERP Z))
(NUMBERP X))
(EQUAL X 0)).
But this again simplifies, using linear arithmetic, to:
T.
Case 11.1.
(IMPLIES (AND (NOT (LESSP Y X))
(NOT (LESSP X Y))
(NOT (NUMBERP Y))
(NOT (NUMBERP Z))
(NUMBERP X))
(EQUAL X 0)),
which again simplifies, unfolding the definition of LESSP, to:
T.
Case 10.(IMPLIES (AND (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y))
(NOT (LESSP X Y))
(NOT (LESSP Z Y))
(NUMBERP Z)
(NOT (NUMBERP X)))
(EQUAL (EQUAL 0 Z) T)),
which again simplifies, rewriting with EQUAL-DIFFERENCE-0, and opening up
the functions DIFFERENCE, LESSP, and EQUAL, to the following two new
formulas:
Case 10.2.
(IMPLIES (AND (NOT (LESSP Y Z))
(EQUAL Y 0)
(NUMBERP Z)
(NOT (NUMBERP X)))
(EQUAL 0 Z)).
But this again simplifies, using linear arithmetic, to:
T.
Case 10.1.
(IMPLIES (AND (NOT (LESSP Y Z))
(NOT (NUMBERP Y))
(NUMBERP Z)
(NOT (NUMBERP X)))
(EQUAL 0 Z)),
which again simplifies, expanding the function LESSP, to:
T.
Case 9. (IMPLIES (AND (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y))
(NOT (LESSP X Y))
(NOT (LESSP Z Y))
(NUMBERP Z)
(NUMBERP X))
(EQUAL (EQUAL X Z) T)),
which again simplifies, obviously, to the new formula:
(IMPLIES (AND (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y))
(NOT (LESSP X Y))
(NOT (LESSP Z Y))
(NUMBERP Z)
(NUMBERP X))
(EQUAL X Z)),
which again simplifies, using linear arithmetic, to:
T.
Case 8. (IMPLIES (AND (NOT (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y)))
(NOT (LESSP X Y))
(NOT (LESSP Z Y))
(NOT (NUMBERP Z)))
(NOT (EQUAL X 0))),
which again simplifies, opening up the functions EQUAL and DIFFERENCE, to:
T.
Case 7. (IMPLIES (AND (NOT (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y)))
(NOT (LESSP X Y))
(NOT (LESSP Z Y))
(NOT (NUMBERP X)))
(NOT (EQUAL 0 Z))),
which again simplifies, expanding the functions DIFFERENCE and EQUAL, to:
T.
Case 6. (IMPLIES (AND (NOT (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y)))
(NOT (LESSP X Y))
(NOT (LESSP Z Y))
(NUMBERP Z)
(NUMBERP X))
(NOT (EQUAL X Z))),
which again simplifies, trivially, to:
T.
Case 5. (IMPLIES (AND (NOT (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y)))
(LESSP X Y))
(LESSP Y Z)).
Call the above conjecture *1.
Case 4. (IMPLIES (AND (NOT (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y)))
(NOT (LESSP X Y))
(NOT (LESSP Z Y))
(NOT (NUMBERP Z)))
(NUMBERP X)).
This again simplifies, unfolding DIFFERENCE and EQUAL, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y)))
(NOT (LESSP X Y))
(LESSP Z Y))
(LESSP Y X)),
which again simplifies, using linear arithmetic, to three new formulas:
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP Y))
(NOT (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y)))
(NOT (LESSP X Y))
(LESSP Z Y))
(LESSP Y X)),
which again simplifies, expanding DIFFERENCE and LESSP, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP X))
(NOT (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y)))
(NOT (LESSP X Y))
(LESSP Z Y))
(LESSP Y X)),
which again simplifies, appealing to the lemma EQUAL-DIFFERENCE-0, and
unfolding the functions DIFFERENCE, LESSP, and EQUAL, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP X)
(NUMBERP Y)
(NOT (EQUAL (DIFFERENCE X X)
(DIFFERENCE Z X)))
(NOT (LESSP X X))
(LESSP Z X))
(LESSP X X)),
which again simplifies, trivially, to the new conjecture:
(IMPLIES (AND (NUMBERP X)
(NUMBERP Y)
(NOT (EQUAL (DIFFERENCE X X)
(DIFFERENCE Z X)))
(LESSP Z X))
(LESSP X X)),
which we would normally push and work on later by induction. But if we
must use induction to prove the input conjecture, we prefer to induct on
the original formulation of the problem. Thus we will disregard all that
we have previously done, give the name *1 to the original input, and work
on it.
So now let us return to:
(EQUAL (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y))
(COND ((LESSP X Y) (NOT (LESSP Y Z)))
((LESSP Z Y) (NOT (LESSP Y X)))
(T (EQUAL (FIX X) (FIX Z))))),
named *1. Let us appeal to the induction principle. The recursive terms in
the conjecture suggest 12 inductions. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP X) (p X Y Z))
(IMPLIES (AND (NOT (ZEROP X)) (ZEROP Y))
(p X Y Z))
(IMPLIES (AND (NOT (ZEROP X))
(NOT (ZEROP Y))
(p (SUB1 X) (SUB1 Y) (SUB1 Z)))
(p X Y Z))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to establish that the measure (COUNT X) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instances chosen for Z and Y. The above induction
scheme generates the following three new goals:
Case 3. (IMPLIES (ZEROP X)
(EQUAL (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y))
(COND ((LESSP X Y) (NOT (LESSP Y Z)))
((LESSP Z Y) (NOT (LESSP Y X)))
(T (EQUAL (FIX X) (FIX Z)))))).
This simplifies, opening up the functions ZEROP, EQUAL, DIFFERENCE, LESSP,
NOT, and FIX, to the following 12 new goals:
Case 3.12.
(IMPLIES (AND (EQUAL X 0)
(NUMBERP Z)
(EQUAL Y 0)
(EQUAL 0 Z))
(EQUAL (EQUAL 0 Z) T)).
However this again simplifies, opening up the definitions of NUMBERP and
EQUAL, to:
T.
Case 3.11.
(IMPLIES (AND (EQUAL X 0)
(NUMBERP Z)
(NOT (NUMBERP Y))
(EQUAL 0 Z))
(EQUAL (EQUAL 0 Z) T)),
which again simplifies, expanding the definitions of NUMBERP and EQUAL, to:
T.
Case 3.10.
(IMPLIES (AND (EQUAL X 0)
(EQUAL Z 0)
(NOT (NUMBERP Y))
(NUMBERP Z))
(EQUAL (EQUAL 0 Z) T)),
which again simplifies, unfolding the functions NUMBERP and EQUAL, to:
T.
Case 3.9.
(IMPLIES (AND (EQUAL X 0)
(EQUAL Z 0)
(EQUAL Y 0)
(NUMBERP Z))
(EQUAL (EQUAL 0 Z) T)),
which again simplifies, expanding the functions NUMBERP and EQUAL, to:
T.
Case 3.8.
(IMPLIES (AND (EQUAL X 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (EQUAL 0
(DIFFERENCE (SUB1 Z) (SUB1 Y)))))
(LESSP (SUB1 Y) (SUB1 Z))),
which again simplifies, appealing to the lemma EQUAL-DIFFERENCE-0, to:
T.
Case 3.7.
(IMPLIES (AND (EQUAL X 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(EQUAL 0
(DIFFERENCE (SUB1 Z) (SUB1 Y))))
(NOT (LESSP (SUB1 Y) (SUB1 Z)))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.6.
(IMPLIES (AND (NOT (NUMBERP X))
(NUMBERP Z)
(EQUAL Y 0)
(EQUAL 0 Z))
(EQUAL (EQUAL 0 Z) T)),
which again simplifies, opening up the definitions of NUMBERP and EQUAL,
to:
T.
Case 3.5.
(IMPLIES (AND (NOT (NUMBERP X))
(NUMBERP Z)
(NOT (NUMBERP Y))
(EQUAL 0 Z))
(EQUAL (EQUAL 0 Z) T)),
which again simplifies, expanding NUMBERP and EQUAL, to:
T.
Case 3.4.
(IMPLIES (AND (NOT (NUMBERP X))
(EQUAL Z 0)
(NOT (NUMBERP Y))
(NUMBERP Z))
(EQUAL (EQUAL 0 Z) T)),
which again simplifies, unfolding NUMBERP and EQUAL, to:
T.
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP X))
(EQUAL Z 0)
(EQUAL Y 0)
(NUMBERP Z))
(EQUAL (EQUAL 0 Z) T)),
which again simplifies, opening up NUMBERP and EQUAL, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP X))
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (EQUAL 0
(DIFFERENCE (SUB1 Z) (SUB1 Y)))))
(LESSP (SUB1 Y) (SUB1 Z))),
which again simplifies, rewriting with EQUAL-DIFFERENCE-0, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (NUMBERP X))
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(EQUAL 0
(DIFFERENCE (SUB1 Z) (SUB1 Y))))
(NOT (LESSP (SUB1 Y) (SUB1 Z)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP X)) (ZEROP Y))
(EQUAL (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y))
(COND ((LESSP X Y) (NOT (LESSP Y Z)))
((LESSP Z Y) (NOT (LESSP Y X)))
(T (EQUAL (FIX X) (FIX Z)))))),
which simplifies, expanding ZEROP, EQUAL, DIFFERENCE, LESSP, and FIX, to
four new goals:
Case 2.4.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL Y 0)
(NUMBERP Z)
(EQUAL X Z))
(EQUAL (EQUAL X Z) T)),
which again simplifies, expanding the function EQUAL, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL Y 0)
(NUMBERP Z)
(EQUAL X Z))
(NOT (EQUAL Z 0))),
which again simplifies, trivially, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (NUMBERP Y))
(NUMBERP Z)
(EQUAL X Z))
(EQUAL (EQUAL X Z) T)).
This again simplifies, expanding EQUAL, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (NUMBERP Y))
(NUMBERP Z)
(EQUAL X Z))
(NOT (EQUAL Z 0))),
which again simplifies, trivially, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(NOT (ZEROP Y))
(EQUAL (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y)))
(COND ((LESSP (SUB1 X) (SUB1 Y))
(NOT (LESSP (SUB1 Y) (SUB1 Z))))
((LESSP (SUB1 Z) (SUB1 Y))
(NOT (LESSP (SUB1 Y) (SUB1 X))))
(T (EQUAL (FIX (SUB1 X))
(FIX (SUB1 Z)))))))
(EQUAL (EQUAL (DIFFERENCE X Y)
(DIFFERENCE Z Y))
(COND ((LESSP X Y) (NOT (LESSP Y Z)))
((LESSP Z Y) (NOT (LESSP Y X)))
(T (EQUAL (FIX X) (FIX Z)))))).
This simplifies, unfolding the definitions of ZEROP, NOT, FIX, DIFFERENCE,
and LESSP, to the following 18 new goals:
Case 1.18.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y)))
(NOT (LESSP (SUB1 X) (SUB1 Y)))
(LESSP (SUB1 Z) (SUB1 Y))
(NOT (LESSP (SUB1 Y) (SUB1 X)))
(NOT (NUMBERP Z)))
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)).
This again simplifies, using linear arithmetic, to:
T.
Case 1.17.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y)))
(NOT (LESSP (SUB1 X) (SUB1 Y)))
(LESSP (SUB1 Z) (SUB1 Y))
(NOT (LESSP (SUB1 Y) (SUB1 X)))
(EQUAL Z 0))
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.16.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y)))
(LESSP (SUB1 X) (SUB1 Y))
(NOT (LESSP (SUB1 Y) (SUB1 Z)))
(NOT (NUMBERP Z)))
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)),
which again simplifies, applying EQUAL-DIFFERENCE-0, to:
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y)))
(LESSP (SUB1 X) (SUB1 Y))
(NOT (LESSP (SUB1 Y) (SUB1 Z)))
(NOT (NUMBERP Z)))
(NOT (LESSP (SUB1 Y) (SUB1 X)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.15.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y)))
(LESSP (SUB1 X) (SUB1 Y))
(NOT (LESSP (SUB1 Y) (SUB1 Z)))
(EQUAL Z 0))
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)),
which again simplifies, applying EQUAL-DIFFERENCE-0, and unfolding the
functions SUB1, EQUAL, DIFFERENCE, and LESSP, to:
T.
Case 1.14.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y))))
(NOT (LESSP (SUB1 X) (SUB1 Y)))
(LESSP (SUB1 Z) (SUB1 Y))
(LESSP (SUB1 Y) (SUB1 X))
(NOT (NUMBERP Z)))
(NOT (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.13.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y))))
(NOT (LESSP (SUB1 X) (SUB1 Y)))
(LESSP (SUB1 Z) (SUB1 Y))
(LESSP (SUB1 Y) (SUB1 X))
(EQUAL Z 0))
(NOT (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.12.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y))))
(LESSP (SUB1 X) (SUB1 Y))
(LESSP (SUB1 Y) (SUB1 Z))
(EQUAL Z 0))
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)),
which again simplifies, rewriting with EQUAL-DIFFERENCE-0, and expanding
the definitions of SUB1, EQUAL, DIFFERENCE, and LESSP, to:
T.
Case 1.11.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y))))
(LESSP (SUB1 X) (SUB1 Y))
(LESSP (SUB1 Y) (SUB1 Z))
(NOT (NUMBERP Z)))
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)).
However this again simplifies, rewriting with EQUAL-DIFFERENCE-0, to the
new conjecture:
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y))))
(LESSP (SUB1 X) (SUB1 Y))
(LESSP (SUB1 Y) (SUB1 Z))
(NOT (NUMBERP Z)))
(NOT (LESSP (SUB1 Y) (SUB1 X)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.10.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y))))
(NOT (LESSP (SUB1 X) (SUB1 Y)))
(NOT (LESSP (SUB1 Z) (SUB1 Y)))
(NOT (EQUAL (SUB1 X) (SUB1 Z)))
(EQUAL Z 0)
(NOT (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)))
(LESSP (SUB1 Y) (SUB1 X))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.9.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y))))
(NOT (LESSP (SUB1 X) (SUB1 Y)))
(NOT (LESSP (SUB1 Z) (SUB1 Y)))
(NOT (EQUAL (SUB1 X) (SUB1 Z)))
(EQUAL Z 0)
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0))
(NOT (LESSP (SUB1 Y) (SUB1 X)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.8.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y))))
(NOT (LESSP (SUB1 X) (SUB1 Y)))
(NOT (LESSP (SUB1 Z) (SUB1 Y)))
(NOT (EQUAL (SUB1 X) (SUB1 Z)))
(NOT (NUMBERP Z))
(NOT (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)))
(LESSP (SUB1 Y) (SUB1 X))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y))))
(NOT (LESSP (SUB1 X) (SUB1 Y)))
(NOT (LESSP (SUB1 Z) (SUB1 Y)))
(NOT (EQUAL (SUB1 X) (SUB1 Z)))
(NOT (NUMBERP Z))
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0))
(NOT (LESSP (SUB1 Y) (SUB1 X)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y))))
(NOT (LESSP (SUB1 X) (SUB1 Y)))
(NOT (LESSP (SUB1 Z) (SUB1 Y)))
(NOT (EQUAL (SUB1 X) (SUB1 Z)))
(NOT (EQUAL Z 0))
(NUMBERP Z))
(NOT (EQUAL X Z))),
which again simplifies, clearly, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y)))
(NOT (LESSP (SUB1 X) (SUB1 Y)))
(NOT (LESSP (SUB1 Z) (SUB1 Y)))
(EQUAL (EQUAL (SUB1 X) (SUB1 Z)) T)
(EQUAL Z 0)
(NOT (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)))
(LESSP (SUB1 Y) (SUB1 X))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y)))
(NOT (LESSP (SUB1 X) (SUB1 Y)))
(NOT (LESSP (SUB1 Z) (SUB1 Y)))
(EQUAL (EQUAL (SUB1 X) (SUB1 Z)) T)
(EQUAL Z 0)
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0))
(NOT (LESSP (SUB1 Y) (SUB1 X)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y)))
(NOT (LESSP (SUB1 X) (SUB1 Y)))
(NOT (LESSP (SUB1 Z) (SUB1 Y)))
(EQUAL (EQUAL (SUB1 X) (SUB1 Z)) T)
(NOT (NUMBERP Z))
(NOT (EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)))
(LESSP (SUB1 Y) (SUB1 X))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y)))
(NOT (LESSP (SUB1 X) (SUB1 Y)))
(NOT (LESSP (SUB1 Z) (SUB1 Y)))
(EQUAL (EQUAL (SUB1 X) (SUB1 Z)) T)
(NOT (NUMBERP Z))
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0))
(NOT (LESSP (SUB1 Y) (SUB1 X)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y)))
(NOT (LESSP (SUB1 X) (SUB1 Y)))
(NOT (LESSP (SUB1 Z) (SUB1 Y)))
(EQUAL (EQUAL (SUB1 X) (SUB1 Z)) T)
(NOT (EQUAL Z 0))
(NUMBERP Z))
(EQUAL (EQUAL X Z) T)),
which again simplifies, obviously, to:
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
(DIFFERENCE (SUB1 Z) (SUB1 Y)))
(NOT (LESSP (SUB1 X) (SUB1 Y)))
(NOT (LESSP (SUB1 Z) (SUB1 Y)))
(EQUAL (SUB1 X) (SUB1 Z))
(NOT (EQUAL Z 0))
(NUMBERP Z))
(EQUAL X Z)),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.1 ]
DIFFERENCE-CANCELLATION
(DISABLE DIFFERENCE-CANCELLATION)
[ 0.0 0.0 0.0 ]
DIFFERENCE-CANCELLATION-OFF
(LEMMA COMMUTATIVITY-OF-PLUS
(REWRITE)
(EQUAL (PLUS X Y) (PLUS Y X)))
This formula simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
COMMUTATIVITY-OF-PLUS
(LEMMA COMMUTATIVITY2-OF-PLUS
(REWRITE)
(EQUAL (PLUS X (PLUS Y Z))
(PLUS Y (PLUS X Z))))
WARNING: the previously added lemma, COMMUTATIVITY-OF-PLUS, could be applied
whenever the newly proposed COMMUTATIVITY2-OF-PLUS could!
This simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
COMMUTATIVITY2-OF-PLUS
(LEMMA PLUS-ZERO-ARG2
(REWRITE)
(IMPLIES (ZEROP Y)
(EQUAL (PLUS X Y) (FIX X)))
((INDUCT (PLUS X Y))))
WARNING: the previously added lemma, COMMUTATIVITY-OF-PLUS, could be applied
whenever the newly proposed PLUS-ZERO-ARG2 could!
This formula can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to the following two new formulas:
Case 2. (IMPLIES (AND (ZEROP X) (ZEROP Y))
(EQUAL (PLUS X Y) (FIX X))).
This simplifies, expanding the functions ZEROP, PLUS, FIX, EQUAL, and
NUMBERP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(IMPLIES (ZEROP Y)
(EQUAL (PLUS (SUB1 X) Y)
(FIX (SUB1 X))))
(ZEROP Y))
(EQUAL (PLUS X Y) (FIX X))).
This simplifies, applying the lemma ADD1-SUB1, and expanding ZEROP, FIX,
IMPLIES, and PLUS, to:
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (PLUS (SUB1 X) Y) (SUB1 X))
(EQUAL Y 0))
(EQUAL (ADD1 (PLUS (SUB1 X) 0)) X)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
PLUS-ZERO-ARG2
(LEMMA PLUS-ADD1-ARG1
(REWRITE)
(EQUAL (PLUS (ADD1 A) B)
(ADD1 (PLUS A B))))
WARNING: the previously added lemma, COMMUTATIVITY-OF-PLUS, could be applied
whenever the newly proposed PLUS-ADD1-ARG1 could!
This conjecture simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
PLUS-ADD1-ARG1
(LEMMA PLUS-ADD1-ARG2
(REWRITE)
(EQUAL (PLUS X (ADD1 Y))
(IF (NUMBERP Y)
(ADD1 (PLUS X Y))
(ADD1 X))))
WARNING: the previously added lemma, COMMUTATIVITY-OF-PLUS, could be applied
whenever the newly proposed PLUS-ADD1-ARG2 could!
This simplifies, obviously, to two new formulas:
Case 2. (IMPLIES (NOT (NUMBERP Y))
(EQUAL (PLUS X (ADD1 Y)) (ADD1 X))),
which again simplifies, rewriting with the lemma SUB1-TYPE-RESTRICTION, to
the conjecture:
(IMPLIES (NOT (NUMBERP Y))
(EQUAL (PLUS X 1) (ADD1 X))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (NUMBERP Y)
(EQUAL (PLUS X (ADD1 Y))
(ADD1 (PLUS X Y)))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
PLUS-ADD1-ARG2
(LEMMA ASSOCIATIVITY-OF-PLUS
(REWRITE)
(EQUAL (PLUS (PLUS X Y) Z)
(PLUS X (PLUS Y Z))))
WARNING: the previously added lemma, COMMUTATIVITY-OF-PLUS, could be applied
whenever the newly proposed ASSOCIATIVITY-OF-PLUS could!
This simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ASSOCIATIVITY-OF-PLUS
(LEMMA PLUS-DIFFERENCE-ARG1
(REWRITE)
(EQUAL (PLUS (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE (PLUS A C) B)
(PLUS 0 C)))
((INDUCT (DIFFERENCE A B))))
WARNING: the previously added lemma, COMMUTATIVITY-OF-PLUS, could be applied
whenever the newly proposed PLUS-DIFFERENCE-ARG1 could!
This conjecture can be simplified, using the abbreviations ZEROP, NOT, OR, and
AND, to three new formulas:
Case 3. (IMPLIES (ZEROP A)
(EQUAL (PLUS (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE (PLUS A C) B)
(PLUS 0 C)))),
which simplifies, unfolding the functions ZEROP, EQUAL, DIFFERENCE, PLUS,
and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(ZEROP B))
(EQUAL (PLUS (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE (PLUS A C) B)
(PLUS 0 C)))),
which simplifies, unfolding the definitions of ZEROP, EQUAL, DIFFERENCE, and
LESSP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(EQUAL (PLUS (DIFFERENCE (SUB1 A) (SUB1 B))
C)
(IF (LESSP (SUB1 B) (SUB1 A))
(DIFFERENCE (PLUS (SUB1 A) C)
(SUB1 B))
(PLUS 0 C))))
(EQUAL (PLUS (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE (PLUS A C) B)
(PLUS 0 C)))),
which simplifies, rewriting with SUB1-ADD1, and unfolding the functions
EQUAL, PLUS, DIFFERENCE, and LESSP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
PLUS-DIFFERENCE-ARG1
(LEMMA PLUS-DIFFERENCE-ARG2
(REWRITE)
(EQUAL (PLUS A (DIFFERENCE B C))
(IF (LESSP C B)
(DIFFERENCE (PLUS A B) C)
(PLUS A 0)))
((INDUCT (PLUS A B))))
WARNING: the previously added lemma, COMMUTATIVITY-OF-PLUS, could be applied
whenever the newly proposed PLUS-DIFFERENCE-ARG2 could!
This formula can be simplified, using the abbreviations ZEROP, NOT, OR, and
AND, to the following two new formulas:
Case 2. (IMPLIES (ZEROP A)
(EQUAL (PLUS A (DIFFERENCE B C))
(IF (LESSP C B)
(DIFFERENCE (PLUS A B) C)
(PLUS A 0)))).
This simplifies, expanding ZEROP, EQUAL, PLUS, and NUMBERP, to the following
four new formulas:
Case 2.4.
(IMPLIES (AND (EQUAL A 0) (NOT (LESSP C B)))
(EQUAL (DIFFERENCE B C) 0)).
This again simplifies, trivially, to the new formula:
(IMPLIES (NOT (LESSP C B))
(EQUAL (DIFFERENCE B C) 0)),
which we will name *1.
Case 2.3.
(IMPLIES (AND (EQUAL A 0)
(LESSP C B)
(NOT (NUMBERP B)))
(EQUAL (DIFFERENCE B C)
(DIFFERENCE 0 C))).
However this again simplifies, opening up LESSP, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (LESSP C B)))
(EQUAL (DIFFERENCE B C) 0)),
which we will name *2.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP A))
(LESSP C B)
(NOT (NUMBERP B)))
(EQUAL (DIFFERENCE B C)
(DIFFERENCE 0 C))).
This again simplifies, expanding the definition of LESSP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (PLUS (SUB1 A) (DIFFERENCE B C))
(IF (LESSP C B)
(DIFFERENCE (PLUS (SUB1 A) B) C)
(PLUS (SUB1 A) 0))))
(EQUAL (PLUS A (DIFFERENCE B C))
(IF (LESSP C B)
(DIFFERENCE (PLUS A B) C)
(PLUS A 0)))),
which simplifies, rewriting with SUB1-ADD1, and unfolding the definitions of
PLUS and DIFFERENCE, to the following three new goals:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(LESSP C B)
(EQUAL (PLUS (SUB1 A) (DIFFERENCE B C))
(DIFFERENCE (PLUS (SUB1 A) B) C))
(NOT (EQUAL C 0))
(NUMBERP C))
(EQUAL (ADD1 (DIFFERENCE (PLUS (SUB1 A) B) C))
(DIFFERENCE (PLUS (SUB1 A) B)
(SUB1 C)))).
But this again simplifies, using linear arithmetic, to two new formulas:
Case 1.3.2.
(IMPLIES (AND (LESSP (PLUS (SUB1 A) B) C)
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP C B)
(EQUAL (PLUS (SUB1 A) (DIFFERENCE B C))
(DIFFERENCE (PLUS (SUB1 A) B) C))
(NOT (EQUAL C 0))
(NUMBERP C))
(EQUAL (ADD1 (DIFFERENCE (PLUS (SUB1 A) B) C))
(DIFFERENCE (PLUS (SUB1 A) B)
(SUB1 C)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.1.
(IMPLIES (AND (LESSP (PLUS (SUB1 A) B) (SUB1 C))
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP C B)
(EQUAL (PLUS (SUB1 A) (DIFFERENCE B C))
(DIFFERENCE (PLUS (SUB1 A) B) C))
(NOT (EQUAL C 0))
(NUMBERP C))
(EQUAL (ADD1 (DIFFERENCE (PLUS (SUB1 A) B) C))
(DIFFERENCE (PLUS (SUB1 A) B)
(SUB1 C)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(LESSP C B)
(EQUAL (PLUS (SUB1 A) (DIFFERENCE B C))
(DIFFERENCE (PLUS (SUB1 A) B) C))
(EQUAL C 0))
(EQUAL (ADD1 (DIFFERENCE (PLUS (SUB1 A) B) C))
(ADD1 (PLUS (SUB1 A) B)))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP (PLUS (SUB1 A) B) 0)
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP 0 B)
(EQUAL (PLUS (SUB1 A) (DIFFERENCE B 0))
(DIFFERENCE (PLUS (SUB1 A) B) 0)))
(EQUAL (ADD1 (DIFFERENCE (PLUS (SUB1 A) B) 0))
(ADD1 (PLUS (SUB1 A) B)))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(LESSP C B)
(EQUAL (PLUS (SUB1 A) (DIFFERENCE B C))
(DIFFERENCE (PLUS (SUB1 A) B) C))
(NOT (NUMBERP C)))
(EQUAL (ADD1 (DIFFERENCE (PLUS (SUB1 A) B) C))
(ADD1 (PLUS (SUB1 A) B)))),
which again simplifies, applying ADD1-EQUAL, and unfolding the functions
LESSP and DIFFERENCE, to:
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (NUMBERP C))
(EQUAL (PLUS (SUB1 A) B) 0))
(EQUAL 0 (PLUS (SUB1 A) B))),
which again simplifies, clearly, to:
T.
So we now return to:
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (LESSP C B)))
(EQUAL (DIFFERENCE B C) 0)),
named *2 above. What luck! This conjecture is subsumed by formula *1 above.
So next consider:
(IMPLIES (NOT (LESSP C B))
(EQUAL (DIFFERENCE B C) 0)),
which is formula *1 above. Perhaps we can prove it by induction. Four
inductions are suggested by terms in the conjecture. However, they merge into
one likely candidate induction. We will induct according to the following
scheme:
(AND (IMPLIES (OR (EQUAL B 0) (NOT (NUMBERP B)))
(p B C))
(IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(OR (EQUAL C 0) (NOT (NUMBERP C))))
(p B C))
(IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(p (SUB1 B) (SUB1 C)))
(p B C))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT inform us that the measure (COUNT C) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for B. The above induction scheme
leads to the following four new conjectures:
Case 4. (IMPLIES (AND (OR (EQUAL B 0) (NOT (NUMBERP B)))
(NOT (LESSP C B)))
(EQUAL (DIFFERENCE B C) 0)).
This simplifies, unfolding the definitions of NOT, OR, EQUAL, LESSP, and
DIFFERENCE, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(OR (EQUAL C 0) (NOT (NUMBERP C)))
(NOT (LESSP C B)))
(EQUAL (DIFFERENCE B C) 0)).
This simplifies, unfolding the definitions of NOT, OR, EQUAL, and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(LESSP (SUB1 C) (SUB1 B))
(NOT (LESSP C B)))
(EQUAL (DIFFERENCE B C) 0)).
This simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP B 1)
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(LESSP (SUB1 C) (SUB1 B))
(NOT (LESSP C B)))
(EQUAL (DIFFERENCE B C) 0)),
which again simplifies, expanding the functions SUB1, NUMBERP, EQUAL, LESSP,
NOT, and OR, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(EQUAL (DIFFERENCE (SUB1 B) (SUB1 C))
0)
(NOT (LESSP C B)))
(EQUAL (DIFFERENCE B C) 0)),
which simplifies, using linear arithmetic, to three new formulas:
Case 1.3.
(IMPLIES (AND (LESSP B C)
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(EQUAL (DIFFERENCE (SUB1 B) (SUB1 C))
0)
(NOT (LESSP C B)))
(EQUAL (DIFFERENCE B C) 0)),
which again simplifies, using linear arithmetic, to two new formulas:
Case 1.3.2.
(IMPLIES (AND (LESSP (SUB1 B) (SUB1 C))
(LESSP B C)
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(EQUAL (DIFFERENCE (SUB1 B) (SUB1 C))
0)
(NOT (LESSP C B)))
(EQUAL (DIFFERENCE B C) 0)),
which again simplifies, opening up the functions LESSP, NOT, OR,
DIFFERENCE, and EQUAL, to:
T.
Case 1.3.1.
(IMPLIES (AND (LESSP B 1)
(LESSP B C)
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(EQUAL (DIFFERENCE (SUB1 B) (SUB1 C))
0)
(NOT (LESSP C B)))
(EQUAL (DIFFERENCE B C) 0)),
which again simplifies, expanding the definitions of SUB1, NUMBERP,
EQUAL, LESSP, NOT, and OR, to:
T.
Case 1.2.
(IMPLIES (AND (LESSP (SUB1 B) (SUB1 C))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(EQUAL (DIFFERENCE (SUB1 B) (SUB1 C))
0)
(NOT (LESSP C B)))
(EQUAL (DIFFERENCE B C) 0)),
which again simplifies, opening up the functions NOT, OR, LESSP,
DIFFERENCE, and EQUAL, to:
T.
Case 1.1.
(IMPLIES (AND (LESSP B 1)
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(EQUAL (DIFFERENCE (SUB1 B) (SUB1 C))
0)
(NOT (LESSP C B)))
(EQUAL (DIFFERENCE B C) 0)),
which again simplifies, unfolding SUB1, NUMBERP, EQUAL, LESSP, NOT, and OR,
to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.1 ]
PLUS-DIFFERENCE-ARG2
(LEMMA DIFFERENCE-PLUS-CANCELLATION-PROOF NIL
(EQUAL (DIFFERENCE (PLUS X Y) X)
(FIX Y)))
This conjecture simplifies, opening up the function FIX, to the following two
new goals:
Case 2. (IMPLIES (NOT (NUMBERP Y))
(EQUAL (DIFFERENCE (PLUS X Y) X) 0)).
Give the above formula the name *1.
Case 1. (IMPLIES (NUMBERP Y)
(EQUAL (DIFFERENCE (PLUS X Y) X) Y)).
This again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP (PLUS X Y) X) (NUMBERP Y))
(EQUAL (DIFFERENCE (PLUS X Y) X) Y)).
However this again simplifies, using linear arithmetic, to:
T.
So we now return to:
(IMPLIES (NOT (NUMBERP Y))
(EQUAL (DIFFERENCE (PLUS X Y) X) 0)),
which we named *1 above. Let us appeal to the induction principle. There are
two plausible inductions. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP (PLUS X Y)) (p X Y))
(IMPLIES (AND (NOT (ZEROP (PLUS X Y)))
(ZEROP X))
(p X Y))
(IMPLIES (AND (NOT (ZEROP (PLUS X Y)))
(NOT (ZEROP X))
(p (SUB1 X) Y))
(p X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to show that the measure (COUNT X) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme generates the following three new goals:
Case 3. (IMPLIES (AND (ZEROP (PLUS X Y))
(NOT (NUMBERP Y)))
(EQUAL (DIFFERENCE (PLUS X Y) X) 0)).
This simplifies, unfolding the definitions of PLUS, ZEROP, EQUAL, and
DIFFERENCE, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP (PLUS X Y)))
(ZEROP X)
(NOT (NUMBERP Y)))
(EQUAL (DIFFERENCE (PLUS X Y) X) 0)).
This simplifies, opening up PLUS and ZEROP, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP (PLUS X Y)))
(NOT (ZEROP X))
(EQUAL (DIFFERENCE (PLUS (SUB1 X) Y)
(SUB1 X))
0)
(NOT (NUMBERP Y)))
(EQUAL (DIFFERENCE (PLUS X Y) X) 0)).
This simplifies, using linear arithmetic, to the following two new
conjectures:
Case 1.2.
(IMPLIES (AND (LESSP (PLUS X Y) X)
(NOT (ZEROP (PLUS X Y)))
(NOT (ZEROP X))
(EQUAL (DIFFERENCE (PLUS (SUB1 X) Y)
(SUB1 X))
0)
(NOT (NUMBERP Y)))
(EQUAL (DIFFERENCE (PLUS X Y) X) 0)).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (LESSP X 1)
(NOT (ZEROP (PLUS X Y)))
(NOT (ZEROP X))
(EQUAL (DIFFERENCE (PLUS (SUB1 X) Y)
(SUB1 X))
0)
(NOT (NUMBERP Y)))
(EQUAL (DIFFERENCE (PLUS X Y) X) 0)),
which again simplifies, expanding SUB1, NUMBERP, EQUAL, LESSP, PLUS, and
ZEROP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-PLUS-CANCELLATION-PROOF
(LEMMA DIFFERENCE-PLUS-CANCELLATION
(REWRITE)
(AND (EQUAL (DIFFERENCE (PLUS X Y) X)
(FIX Y))
(EQUAL (DIFFERENCE (PLUS Y X) X)
(FIX Y)))
((USE (DIFFERENCE-PLUS-CANCELLATION-PROOF (X X)
(Y Y)))
(ENABLE COMMUTATIVITY-OF-PLUS)))
WARNING: Note that the proposed lemma DIFFERENCE-PLUS-CANCELLATION is to be
stored as zero type prescription rules, zero compound recognizer rules, zero
linear rules, and two replacement rules.
This formula simplifies, rewriting with COMMUTATIVITY-OF-PLUS, and expanding
the definitions of FIX, EQUAL, and AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-PLUS-CANCELLATION
(DISABLE DIFFERENCE-PLUS-CANCELLATION)
[ 0.0 0.0 0.0 ]
DIFFERENCE-PLUS-CANCELLATION-OFF
(LEMMA DIFFERENCE-PLUS-PLUS-CANCELLATION-PROOF NIL
(EQUAL (DIFFERENCE (PLUS X Y) (PLUS X Z))
(DIFFERENCE Y Z)))
This simplifies, using linear arithmetic, to the following two new conjectures:
Case 2. (IMPLIES (LESSP (PLUS X Y) (PLUS X Z))
(EQUAL (DIFFERENCE (PLUS X Y) (PLUS X Z))
(DIFFERENCE Y Z))).
Give the above formula the name *1.
Case 1. (IMPLIES (LESSP Y Z)
(EQUAL (DIFFERENCE (PLUS X Y) (PLUS X Z))
(DIFFERENCE Y Z))),
which we would usually push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us consider:
(EQUAL (DIFFERENCE (PLUS X Y) (PLUS X Z))
(DIFFERENCE Y Z)).
We gave this the name *1 above. Perhaps we can prove it by induction. There
are four plausible inductions. They merge into two likely candidate
inductions. However, only one is unflawed. We will induct according to the
following scheme:
(AND (IMPLIES (ZEROP X) (p X Y Z))
(IMPLIES (AND (NOT (ZEROP X)) (p (SUB1 X) Y Z))
(p X Y Z))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definition
of ZEROP establish that the measure (COUNT X) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme produces the following two new conjectures:
Case 2. (IMPLIES (ZEROP X)
(EQUAL (DIFFERENCE (PLUS X Y) (PLUS X Z))
(DIFFERENCE Y Z))).
This simplifies, using linear arithmetic, to the following two new goals:
Case 2.2.
(IMPLIES (AND (LESSP (PLUS X Y) (PLUS X Z))
(ZEROP X))
(EQUAL (DIFFERENCE (PLUS X Y) (PLUS X Z))
(DIFFERENCE Y Z))).
But this again simplifies, unfolding the functions PLUS, ZEROP, EQUAL, and
DIFFERENCE, to:
T.
Case 2.1.
(IMPLIES (AND (LESSP Y Z) (ZEROP X))
(EQUAL (DIFFERENCE (PLUS X Y) (PLUS X Z))
(DIFFERENCE Y Z))),
which again simplifies, opening up ZEROP, EQUAL, and PLUS, to six new
goals:
Case 2.1.6.
(IMPLIES (AND (LESSP Y Z)
(EQUAL X 0)
(NOT (NUMBERP Z))
(NOT (NUMBERP Y)))
(EQUAL (DIFFERENCE 0 0)
(DIFFERENCE Y Z))),
which again simplifies, opening up LESSP, to:
T.
Case 2.1.5.
(IMPLIES (AND (LESSP Y Z)
(EQUAL X 0)
(NOT (NUMBERP Z))
(NUMBERP Y))
(EQUAL (DIFFERENCE Y 0)
(DIFFERENCE Y Z))),
which again simplifies, opening up LESSP, to:
T.
Case 2.1.4.
(IMPLIES (AND (LESSP Y Z)
(EQUAL X 0)
(NUMBERP Z)
(NOT (NUMBERP Y)))
(EQUAL (DIFFERENCE 0 Z)
(DIFFERENCE Y Z))),
which again simplifies, expanding LESSP, EQUAL, and DIFFERENCE, to:
T.
Case 2.1.3.
(IMPLIES (AND (LESSP Y Z)
(NOT (NUMBERP X))
(NOT (NUMBERP Z))
(NOT (NUMBERP Y)))
(EQUAL (DIFFERENCE 0 0)
(DIFFERENCE Y Z))),
which again simplifies, unfolding the definition of LESSP, to:
T.
Case 2.1.2.
(IMPLIES (AND (LESSP Y Z)
(NOT (NUMBERP X))
(NOT (NUMBERP Z))
(NUMBERP Y))
(EQUAL (DIFFERENCE Y 0)
(DIFFERENCE Y Z))),
which again simplifies, expanding LESSP, to:
T.
Case 2.1.1.
(IMPLIES (AND (LESSP Y Z)
(NOT (NUMBERP X))
(NUMBERP Z)
(NOT (NUMBERP Y)))
(EQUAL (DIFFERENCE 0 Z)
(DIFFERENCE Y Z))),
which again simplifies, unfolding the definitions of LESSP, EQUAL, and
DIFFERENCE, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(EQUAL (DIFFERENCE (PLUS (SUB1 X) Y)
(PLUS (SUB1 X) Z))
(DIFFERENCE Y Z)))
(EQUAL (DIFFERENCE (PLUS X Y) (PLUS X Z))
(DIFFERENCE Y Z))),
which simplifies, using linear arithmetic, to two new conjectures:
Case 1.2.
(IMPLIES (AND (LESSP (PLUS X Y) (PLUS X Z))
(NOT (ZEROP X))
(EQUAL (DIFFERENCE (PLUS (SUB1 X) Y)
(PLUS (SUB1 X) Z))
(DIFFERENCE Y Z)))
(EQUAL (DIFFERENCE (PLUS X Y) (PLUS X Z))
(DIFFERENCE Y Z))),
which again simplifies, applying SUB1-ADD1, and unfolding PLUS, ZEROP, and
DIFFERENCE, to:
T.
Case 1.1.
(IMPLIES (AND (LESSP Y Z)
(NOT (ZEROP X))
(EQUAL (DIFFERENCE (PLUS (SUB1 X) Y)
(PLUS (SUB1 X) Z))
(DIFFERENCE Y Z)))
(EQUAL (DIFFERENCE (PLUS X Y) (PLUS X Z))
(DIFFERENCE Y Z))).
But this again simplifies, applying the lemma SUB1-ADD1, and expanding the
definitions of ZEROP, PLUS, and DIFFERENCE, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-PLUS-PLUS-CANCELLATION-PROOF
(LEMMA DIFFERENCE-PLUS-PLUS-CANCELLATION
(REWRITE)
(AND (EQUAL (DIFFERENCE (PLUS X Y) (PLUS X Z))
(DIFFERENCE Y Z))
(EQUAL (DIFFERENCE (PLUS Y X) (PLUS X Z))
(DIFFERENCE Y Z))
(EQUAL (DIFFERENCE (PLUS X Y) (PLUS Z X))
(DIFFERENCE Y Z))
(EQUAL (DIFFERENCE (PLUS Y X) (PLUS Z X))
(DIFFERENCE Y Z)))
((USE (DIFFERENCE-PLUS-PLUS-CANCELLATION-PROOF (X X)
(Y Y)
(Z Z)))
(ENABLE COMMUTATIVITY-OF-PLUS)))
WARNING: Note that the proposed lemma DIFFERENCE-PLUS-PLUS-CANCELLATION is to
be stored as zero type prescription rules, zero compound recognizer rules,
zero linear rules, and four replacement rules.
This simplifies, applying COMMUTATIVITY-OF-PLUS, and unfolding the function
AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-PLUS-PLUS-CANCELLATION
(DISABLE DIFFERENCE-PLUS-PLUS-CANCELLATION)
[ 0.0 0.0 0.0 ]
DIFFERENCE-PLUS-PLUS-CANCELLATION-OFF
(LEMMA DIFFERENCE-PLUS-PLUS-CANCELLATION-HACK
(REWRITE)
(EQUAL (DIFFERENCE (PLUS W X A) (PLUS Y Z A))
(DIFFERENCE (PLUS W X) (PLUS Y Z)))
((ENABLE COMMUTATIVITY-OF-PLUS COMMUTATIVITY2-OF-PLUS
DIFFERENCE-PLUS-PLUS-CANCELLATION)
(DO-NOT-INDUCT T)))
This conjecture simplifies, using linear arithmetic, to the following two new
goals:
Case 2. (IMPLIES (LESSP (PLUS W X A) (PLUS Y Z A))
(EQUAL (DIFFERENCE (PLUS W X A) (PLUS Y Z A))
(DIFFERENCE (PLUS W X) (PLUS Y Z)))).
However this again simplifies, rewriting with COMMUTATIVITY-OF-PLUS,
COMMUTATIVITY2-OF-PLUS, and DIFFERENCE-PLUS-PLUS-CANCELLATION, to:
T.
Case 1. (IMPLIES (LESSP (PLUS W X) (PLUS Y Z))
(EQUAL (DIFFERENCE (PLUS W X A) (PLUS Y Z A))
(DIFFERENCE (PLUS W X) (PLUS Y Z)))).
This again simplifies, applying COMMUTATIVITY-OF-PLUS,
COMMUTATIVITY2-OF-PLUS, and DIFFERENCE-PLUS-PLUS-CANCELLATION, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-PLUS-PLUS-CANCELLATION-HACK
(DISABLE DIFFERENCE-PLUS-PLUS-CANCELLATION-HACK)
[ 0.0 0.0 0.0 ]
DIFFERENCE-PLUS-PLUS-CANCELLATION-HACK-OFF
(LEMMA DIFF-SUB1-ARG2
(REWRITE)
(EQUAL (DIFFERENCE A (SUB1 B))
(IF (ZEROP B)
(FIX A)
(IF (LESSP A B)
0
(ADD1 (DIFFERENCE A B)))))
((INDUCT (DIFFERENCE A B))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, OR, and
AND, to three new conjectures:
Case 3. (IMPLIES (ZEROP A)
(EQUAL (DIFFERENCE A (SUB1 B))
(COND ((ZEROP B) (FIX A))
((LESSP A B) 0)
(T (ADD1 (DIFFERENCE A B)))))),
which simplifies, opening up the definitions of ZEROP, EQUAL, DIFFERENCE,
FIX, LESSP, and ADD1, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(ZEROP B))
(EQUAL (DIFFERENCE A (SUB1 B))
(COND ((ZEROP B) (FIX A))
((LESSP A B) 0)
(T (ADD1 (DIFFERENCE A B)))))),
which simplifies, applying SUB1-NNUMBERP, and unfolding ZEROP, SUB1, EQUAL,
DIFFERENCE, and FIX, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(EQUAL (DIFFERENCE (SUB1 A) (SUB1 (SUB1 B)))
(COND ((ZEROP (SUB1 B)) (FIX (SUB1 A)))
((LESSP (SUB1 A) (SUB1 B)) 0)
(T (ADD1 (DIFFERENCE (SUB1 A) (SUB1 B)))))))
(EQUAL (DIFFERENCE A (SUB1 B))
(COND ((ZEROP B) (FIX A))
((LESSP A B) 0)
(T (ADD1 (DIFFERENCE A B)))))).
This simplifies, opening up ZEROP, FIX, DIFFERENCE, LESSP, and EQUAL, to the
following two new conjectures:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(EQUAL (SUB1 B) 0)
(EQUAL (DIFFERENCE (SUB1 A) (SUB1 (SUB1 B)))
(SUB1 A))
(NOT (EQUAL (SUB1 A) 0)))
(EQUAL A (ADD1 (SUB1 A)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(EQUAL (SUB1 B) 0)
(EQUAL (DIFFERENCE (SUB1 A) (SUB1 (SUB1 B)))
(SUB1 A))
(EQUAL (SUB1 A) 0))
(EQUAL A 1)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFF-SUB1-ARG2
(DISABLE DIFF-SUB1-ARG2)
[ 0.0 0.0 0.0 ]
DIFF-SUB1-ARG2-OFF
(LEMMA DIFF-DIFF-ARG1
(REWRITE)
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z))))
This simplifies, using linear arithmetic, to the following three new
conjectures:
Case 3. (IMPLIES (LESSP (DIFFERENCE X Y) Z)
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z)))).
Give the above formula the name *1.
Case 2. (IMPLIES (LESSP X Y)
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z)))),
which we would usually push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us consider:
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z))).
We gave this the name *1 above. Perhaps we can prove it by induction. There
are five plausible inductions. They merge into two likely candidate
inductions. However, only one is unflawed. We will induct according to the
following scheme:
(AND (IMPLIES (ZEROP X) (p X Y Z))
(IMPLIES (AND (NOT (ZEROP X)) (ZEROP Y))
(p X Y Z))
(IMPLIES (AND (NOT (ZEROP X))
(NOT (ZEROP Y))
(p (SUB1 X) (SUB1 Y) Z))
(p X Y Z))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT X) decreases according to the well-founded
relation LESSP in each induction step of the scheme. Note, however, the
inductive instance chosen for Y. The above induction scheme produces the
following three new conjectures:
Case 3. (IMPLIES (ZEROP X)
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z)))).
This simplifies, using linear arithmetic, to the following three new goals:
Case 3.3.
(IMPLIES (AND (LESSP (DIFFERENCE X Y) Z)
(ZEROP X))
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z)))).
But this again simplifies, unfolding the functions DIFFERENCE, ZEROP,
EQUAL, and PLUS, to:
T.
Case 3.2.
(IMPLIES (AND (LESSP X Y) (ZEROP X))
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z)))),
which again simplifies, opening up ZEROP, EQUAL, DIFFERENCE, and PLUS, to:
T.
Case 3.1.
(IMPLIES (AND (LESSP X (PLUS Y Z)) (ZEROP X))
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z)))),
which again simplifies, opening up the definitions of PLUS, ZEROP, EQUAL,
and DIFFERENCE, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP X)) (ZEROP Y))
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z)))),
which simplifies, using linear arithmetic, to three new conjectures:
Case 2.3.
(IMPLIES (AND (LESSP (DIFFERENCE X Y) Z)
(NOT (ZEROP X))
(ZEROP Y))
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z)))),
which again simplifies, expanding the definitions of DIFFERENCE, ZEROP,
EQUAL, and PLUS, to two new formulas:
Case 2.3.2.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL Y 0)
(LESSP X Z)
(NOT (NUMBERP Z)))
(EQUAL (DIFFERENCE X Z)
(DIFFERENCE X 0))),
which again simplifies, unfolding the definition of LESSP, to:
T.
Case 2.3.1.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (NUMBERP Y))
(LESSP X Z)
(NOT (NUMBERP Z)))
(EQUAL (DIFFERENCE X Z)
(DIFFERENCE X 0))),
which again simplifies, expanding LESSP, to:
T.
Case 2.2.
(IMPLIES (AND (LESSP X Y)
(NOT (ZEROP X))
(ZEROP Y))
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z)))),
which again simplifies, unfolding the definitions of ZEROP, EQUAL,
DIFFERENCE, and PLUS, to two new goals:
Case 2.2.2.
(IMPLIES (AND (LESSP X Y)
(NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL Y 0)
(NOT (NUMBERP Z)))
(EQUAL (DIFFERENCE X Z)
(DIFFERENCE X 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.2.1.
(IMPLIES (AND (LESSP X Y)
(NOT (EQUAL X 0))
(NUMBERP X)
(NOT (NUMBERP Y))
(NOT (NUMBERP Z)))
(EQUAL (DIFFERENCE X Z)
(DIFFERENCE X 0))),
which again simplifies, expanding LESSP, to:
T.
Case 2.1.
(IMPLIES (AND (LESSP X (PLUS Y Z))
(NOT (ZEROP X))
(ZEROP Y))
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z)))),
which again simplifies, opening up the functions PLUS, ZEROP, EQUAL, and
DIFFERENCE, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(NOT (ZEROP Y))
(EQUAL (DIFFERENCE (DIFFERENCE (SUB1 X) (SUB1 Y))
Z)
(DIFFERENCE (SUB1 X)
(PLUS (SUB1 Y) Z))))
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z)))),
which simplifies, using linear arithmetic, to three new conjectures:
Case 1.3.
(IMPLIES (AND (LESSP (DIFFERENCE X Y) Z)
(NOT (ZEROP X))
(NOT (ZEROP Y))
(EQUAL (DIFFERENCE (DIFFERENCE (SUB1 X) (SUB1 Y))
Z)
(DIFFERENCE (SUB1 X)
(PLUS (SUB1 Y) Z))))
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z)))),
which again simplifies, rewriting with SUB1-ADD1, and opening up the
definitions of DIFFERENCE, ZEROP, and PLUS, to:
T.
Case 1.2.
(IMPLIES (AND (LESSP X Y)
(NOT (ZEROP X))
(NOT (ZEROP Y))
(EQUAL (DIFFERENCE (DIFFERENCE (SUB1 X) (SUB1 Y))
Z)
(DIFFERENCE (SUB1 X)
(PLUS (SUB1 Y) Z))))
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z)))).
But this again simplifies, appealing to the lemma SUB1-ADD1, and opening
up the definitions of LESSP, ZEROP, DIFFERENCE, and PLUS, to:
T.
Case 1.1.
(IMPLIES (AND (LESSP X (PLUS Y Z))
(NOT (ZEROP X))
(NOT (ZEROP Y))
(EQUAL (DIFFERENCE (DIFFERENCE (SUB1 X) (SUB1 Y))
Z)
(DIFFERENCE (SUB1 X)
(PLUS (SUB1 Y) Z))))
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z)))),
which again simplifies, applying SUB1-ADD1, and unfolding PLUS, ZEROP, and
DIFFERENCE, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
DIFF-DIFF-ARG1
(LEMMA DIFF-DIFF-ARG2
(REWRITE)
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
(IF (LESSP B C)
(FIX A)
(DIFFERENCE (PLUS A C) B)))
((ENABLE DIFF-SUB1-ARG2 PLUS-ZERO-ARG2)
(INDUCT (DIFFERENCE A B))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, OR, and
AND, to three new goals:
Case 3. (IMPLIES (ZEROP A)
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
(IF (LESSP B C)
(FIX A)
(DIFFERENCE (PLUS A C) B)))),
which simplifies, unfolding the definitions of ZEROP, EQUAL, DIFFERENCE, FIX,
and PLUS, to four new conjectures:
Case 3.4.
(IMPLIES (AND (EQUAL A 0)
(NOT (LESSP B C))
(NUMBERP C))
(EQUAL 0 (DIFFERENCE C B))),
which again simplifies, clearly, to:
(IMPLIES (AND (NOT (LESSP B C)) (NUMBERP C))
(EQUAL 0 (DIFFERENCE C B))),
which we will name *1.
Case 3.3.
(IMPLIES (AND (EQUAL A 0)
(NOT (LESSP B C))
(NOT (NUMBERP C)))
(EQUAL 0 (DIFFERENCE 0 B))).
However this again simplifies, expanding LESSP, EQUAL, and DIFFERENCE, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (LESSP B C))
(NUMBERP C))
(EQUAL 0 (DIFFERENCE C B))),
which we will name *2.
Case 3.1.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (LESSP B C))
(NOT (NUMBERP C)))
(EQUAL 0 (DIFFERENCE 0 B))).
However this again simplifies, expanding the definitions of LESSP, EQUAL,
and DIFFERENCE, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(ZEROP B))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
(IF (LESSP B C)
(FIX A)
(DIFFERENCE (PLUS A C) B)))),
which simplifies, expanding the functions ZEROP, EQUAL, DIFFERENCE, LESSP,
and FIX, to eight new conjectures:
Case 2.8.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL B 0)
(EQUAL C 0))
(NOT (EQUAL (PLUS A C) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.7.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL B 0)
(EQUAL C 0))
(EQUAL A (PLUS A C))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.6.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL B 0)
(NOT (NUMBERP C)))
(EQUAL A (PLUS A C))),
which again simplifies, applying the lemma PLUS-ZERO-ARG2, and opening up
ZEROP, to:
T.
Case 2.5.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL B 0)
(NOT (NUMBERP C)))
(NOT (EQUAL (PLUS A C) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.4.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP B))
(EQUAL C 0))
(NOT (EQUAL (PLUS A C) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP B))
(EQUAL C 0))
(EQUAL A (PLUS A C))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP B))
(NOT (NUMBERP C)))
(EQUAL A (PLUS A C))),
which again simplifies, rewriting with PLUS-ZERO-ARG2, and expanding the
function ZEROP, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP B))
(NOT (NUMBERP C)))
(NOT (EQUAL (PLUS A C) 0))).
This again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
(IF (LESSP (SUB1 B) C)
(FIX (SUB1 A))
(DIFFERENCE (PLUS (SUB1 A) C)
(SUB1 B)))))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
(IF (LESSP B C)
(FIX A)
(DIFFERENCE (PLUS A C) B)))),
which simplifies, appealing to the lemmas DIFF-SUB1-ARG2 and SUB1-ADD1, and
opening up FIX, PLUS, and DIFFERENCE, to seven new goals:
Case 1.7.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (SUB1 B) C))
(LESSP (PLUS (SUB1 A) C) B)
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
0)
(NOT (LESSP B C)))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
0)),
which again simplifies, using linear arithmetic, to two new conjectures:
Case 1.7.2.
(IMPLIES (AND (LESSP A (DIFFERENCE B C))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (SUB1 B) C))
(LESSP (PLUS (SUB1 A) C) B)
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
0)
(NOT (LESSP B C)))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
0)),
which again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES (AND (LESSP (SUB1 A)
(DIFFERENCE (SUB1 B) C))
(LESSP A (DIFFERENCE B C))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (SUB1 B) C))
(LESSP (PLUS (SUB1 A) C) B)
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
0)
(NOT (LESSP B C)))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
0)).
Appealing to the lemma SUB1-ELIM, we now replace A by (ADD1 X) to
eliminate (SUB1 A). We use the type restriction lemma noted when SUB1
was introduced to constrain the new variable. We must thus prove:
(IMPLIES (AND (NUMBERP X)
(LESSP X (DIFFERENCE (SUB1 B) C))
(LESSP (ADD1 X) (DIFFERENCE B C))
(NOT (EQUAL (ADD1 X) 0))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (SUB1 B) C))
(LESSP (PLUS X C) B)
(EQUAL (DIFFERENCE X (DIFFERENCE (SUB1 B) C))
0)
(NOT (LESSP B C)))
(EQUAL (DIFFERENCE (ADD1 X) (DIFFERENCE B C))
0)).
This further simplifies, applying SUB1-ADD1 and DIFF-SUB1-ARG2, and
opening up LESSP and DIFFERENCE, to the new conjecture:
(IMPLIES (AND (NUMBERP X)
(LESSP X (DIFFERENCE (SUB1 B) C))
(NOT (EQUAL (DIFFERENCE B C) 0))
(LESSP X (SUB1 (DIFFERENCE B C)))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (SUB1 B) C))
(LESSP (PLUS X C) B)
(EQUAL (DIFFERENCE X (DIFFERENCE (SUB1 B) C))
0)
(NOT (LESSP B C))
(NOT (LESSP X (DIFFERENCE B C))))
(EQUAL (ADD1 (DIFFERENCE X (DIFFERENCE B C)))
0)),
which finally simplifies, using linear arithmetic, to:
T.
Case 1.7.1.
(IMPLIES (AND (LESSP (SUB1 A)
(DIFFERENCE (SUB1 B) C))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (SUB1 B) C))
(LESSP (PLUS (SUB1 A) C) B)
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
0)
(NOT (LESSP B C)))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
0)).
Applying the lemma SUB1-ELIM, replace A by (ADD1 X) to eliminate
(SUB1 A). We employ the type restriction lemma noted when SUB1 was
introduced to restrict the new variable. We would thus like to prove:
(IMPLIES (AND (NUMBERP X)
(LESSP X (DIFFERENCE (SUB1 B) C))
(NOT (EQUAL (ADD1 X) 0))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (SUB1 B) C))
(LESSP (PLUS X C) B)
(EQUAL (DIFFERENCE X (DIFFERENCE (SUB1 B) C))
0)
(NOT (LESSP B C)))
(EQUAL (DIFFERENCE (ADD1 X) (DIFFERENCE B C))
0)),
which further simplifies, rewriting with SUB1-ADD1 and DIFF-SUB1-ARG2,
and unfolding DIFFERENCE, to the following two new conjectures:
Case 1.7.1.2.
(IMPLIES (AND (NUMBERP X)
(LESSP X (DIFFERENCE (SUB1 B) C))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (SUB1 B) C))
(LESSP (PLUS X C) B)
(EQUAL (DIFFERENCE X (DIFFERENCE (SUB1 B) C))
0)
(NOT (LESSP B C))
(NOT (EQUAL (DIFFERENCE B C) 0))
(NOT (LESSP X (DIFFERENCE B C))))
(EQUAL (ADD1 (DIFFERENCE X (DIFFERENCE B C)))
0)).
This again simplifies, using linear arithmetic, to:
T.
Case 1.7.1.1.
(IMPLIES (AND (NUMBERP X)
(LESSP X (DIFFERENCE (SUB1 B) C))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (SUB1 B) C))
(LESSP (PLUS X C) B)
(EQUAL (DIFFERENCE X (DIFFERENCE (SUB1 B) C))
0)
(NOT (LESSP B C))
(EQUAL (DIFFERENCE B C) 0))
(EQUAL (ADD1 X) 0)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (SUB1 B) C))
(LESSP (PLUS (SUB1 A) C) B)
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
0)
(LESSP B C))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
A)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (SUB1 B) C))
(NOT (LESSP (PLUS (SUB1 A) C) B))
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
(ADD1 (DIFFERENCE (PLUS (SUB1 A) C) B)))
(NOT (LESSP B C)))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
(ADD1 (DIFFERENCE (PLUS (SUB1 A) C) B)))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP A (DIFFERENCE B C))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (SUB1 B) C))
(NOT (LESSP (PLUS (SUB1 A) C) B))
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
(ADD1 (DIFFERENCE (PLUS (SUB1 A) C) B)))
(NOT (LESSP B C)))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
(ADD1 (DIFFERENCE (PLUS (SUB1 A) C) B)))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (SUB1 B) C))
(NOT (LESSP (PLUS (SUB1 A) C) B))
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
(ADD1 (DIFFERENCE (PLUS (SUB1 A) C) B)))
(LESSP B C))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
A)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(LESSP (SUB1 B) C)
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
(SUB1 A))
(NOT (LESSP B C))
(LESSP (PLUS (SUB1 A) C) B))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
0)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(LESSP (SUB1 B) C)
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
(SUB1 A))
(NOT (LESSP B C))
(NOT (LESSP (PLUS (SUB1 A) C) B)))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
(ADD1 (DIFFERENCE (PLUS (SUB1 A) C) B)))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP A (DIFFERENCE B C))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(LESSP (SUB1 B) C)
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
(SUB1 A))
(NOT (LESSP B C))
(NOT (LESSP (PLUS (SUB1 A) C) B)))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
(ADD1 (DIFFERENCE (PLUS (SUB1 A) C) B)))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(LESSP (SUB1 B) C)
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
(SUB1 A))
(LESSP B C))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
A)).
Applying the lemma SUB1-ELIM, replace B by (ADD1 X) to eliminate (SUB1 B).
We employ the type restriction lemma noted when SUB1 was introduced to
restrict the new variable. This produces:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL (ADD1 X) 0))
(LESSP X C)
(EQUAL (DIFFERENCE (SUB1 A) (DIFFERENCE X C))
(SUB1 A))
(LESSP (ADD1 X) C))
(EQUAL (DIFFERENCE A (DIFFERENCE (ADD1 X) C))
A)),
which further simplifies, rewriting with SUB1-ADD1 and DIFF-SUB1-ARG2, and
unfolding the definitions of LESSP, DIFFERENCE, and EQUAL, to:
T.
So next consider:
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (LESSP B C))
(NUMBERP C))
(EQUAL 0 (DIFFERENCE C B))),
which we named *2 above. Ah ha! This conjecture is subsumed by another
subgoal awaiting our attention, namely *1 above.
So we now return to:
(IMPLIES (AND (NOT (LESSP B C)) (NUMBERP C))
(EQUAL 0 (DIFFERENCE C B))),
which we named *1 above. Perhaps we can prove it by induction. There are
four plausible inductions. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (OR (EQUAL C 0) (NOT (NUMBERP C)))
(p C B))
(IMPLIES (AND (NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(OR (EQUAL B 0) (NOT (NUMBERP B))))
(p C B))
(IMPLIES (AND (NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(p (SUB1 C) (SUB1 B)))
(p C B))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT inform us that the measure (COUNT B) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for C. The above induction scheme
leads to the following four new conjectures:
Case 4. (IMPLIES (AND (OR (EQUAL C 0) (NOT (NUMBERP C)))
(NOT (LESSP B C))
(NUMBERP C))
(EQUAL 0 (DIFFERENCE C B))).
This simplifies, opening up NOT, OR, EQUAL, LESSP, NUMBERP, and DIFFERENCE,
to:
T.
Case 3. (IMPLIES (AND (NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(OR (EQUAL B 0) (NOT (NUMBERP B)))
(NOT (LESSP B C))
(NUMBERP C))
(EQUAL 0 (DIFFERENCE C B))).
This simplifies, opening up the functions NOT, OR, EQUAL, and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(LESSP (SUB1 B) (SUB1 C))
(NOT (LESSP B C))
(NUMBERP C))
(EQUAL 0 (DIFFERENCE C B))).
This simplifies, using linear arithmetic, to:
(IMPLIES (AND (EQUAL C 0)
(NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(LESSP (SUB1 B) (SUB1 C))
(NOT (LESSP B C))
(NUMBERP C))
(EQUAL 0 (DIFFERENCE C B))),
which again simplifies, unfolding the functions EQUAL, NUMBERP, NOT, and OR,
to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(EQUAL 0
(DIFFERENCE (SUB1 C) (SUB1 B)))
(NOT (LESSP B C))
(NUMBERP C))
(EQUAL 0 (DIFFERENCE C B))),
which simplifies, using linear arithmetic, to three new formulas:
Case 1.3.
(IMPLIES (AND (LESSP (SUB1 C) (SUB1 B))
(NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(EQUAL 0
(DIFFERENCE (SUB1 C) (SUB1 B)))
(NOT (LESSP B C))
(NUMBERP C))
(EQUAL 0 (DIFFERENCE C B))),
which again simplifies, unfolding the definitions of NOT, OR, LESSP,
DIFFERENCE, and EQUAL, to:
T.
Case 1.2.
(IMPLIES (AND (EQUAL C 0)
(NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(EQUAL 0
(DIFFERENCE (SUB1 C) (SUB1 B)))
(NOT (LESSP B C))
(NUMBERP C))
(EQUAL 0 (DIFFERENCE C B))),
which again simplifies, unfolding EQUAL, NUMBERP, NOT, and OR, to:
T.
Case 1.1.
(IMPLIES (AND (LESSP C B)
(NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(EQUAL 0
(DIFFERENCE (SUB1 C) (SUB1 B)))
(NOT (LESSP B C))
(NUMBERP C))
(EQUAL 0 (DIFFERENCE C B))),
which again simplifies, using linear arithmetic, to two new goals:
Case 1.1.2.
(IMPLIES (AND (LESSP (SUB1 C) (SUB1 B))
(LESSP C B)
(NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(EQUAL 0
(DIFFERENCE (SUB1 C) (SUB1 B)))
(NOT (LESSP B C))
(NUMBERP C))
(EQUAL 0 (DIFFERENCE C B))),
which again simplifies, expanding the definitions of LESSP, NOT, OR,
DIFFERENCE, and EQUAL, to:
T.
Case 1.1.1.
(IMPLIES (AND (EQUAL C 0)
(LESSP C B)
(NOT (OR (EQUAL C 0) (NOT (NUMBERP C))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(EQUAL 0
(DIFFERENCE (SUB1 C) (SUB1 B)))
(NOT (LESSP B C))
(NUMBERP C))
(EQUAL 0 (DIFFERENCE C B))),
which again simplifies, expanding the functions EQUAL, LESSP, NUMBERP,
NOT, and OR, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.1 ]
DIFF-DIFF-ARG2
(LEMMA DIFF-DIFF-DIFF
(REWRITE)
(IMPLIES (AND (LEQ B A) (LEQ D C))
(EQUAL (DIFFERENCE (DIFFERENCE A B)
(DIFFERENCE C D))
(DIFFERENCE (PLUS A D) (PLUS B C))))
((ENABLE DIFF-DIFF-ARG1 DIFF-DIFF-ARG2 PLUS-DIFFERENCE-ARG2
PLUS-ZERO-ARG2)
(DO-NOT-INDUCT T)))
WARNING: the previously added lemma, DIFF-DIFF-ARG2, could be applied
whenever the newly proposed DIFF-DIFF-DIFF could!
WARNING: the previously added lemma, DIFF-DIFF-ARG1, could be applied
whenever the newly proposed DIFF-DIFF-DIFF could!
This formula can be simplified, using the abbreviations AND, IMPLIES, and
DIFF-DIFF-ARG1, to the new goal:
(IMPLIES (AND (NOT (LESSP A B))
(NOT (LESSP C D)))
(EQUAL (DIFFERENCE A
(PLUS B (DIFFERENCE C D)))
(DIFFERENCE (PLUS A D) (PLUS B C)))),
which simplifies, using linear arithmetic, to two new goals:
Case 2. (IMPLIES (AND (LESSP A (PLUS B (DIFFERENCE C D)))
(NOT (LESSP A B))
(NOT (LESSP C D)))
(EQUAL (DIFFERENCE A
(PLUS B (DIFFERENCE C D)))
(DIFFERENCE (PLUS A D) (PLUS B C)))),
which again simplifies, rewriting with PLUS-ZERO-ARG2, PLUS-DIFFERENCE-ARG2,
and DIFF-DIFF-ARG2, and unfolding the functions ZEROP, LESSP, EQUAL,
DIFFERENCE, and PLUS, to the following eight new formulas:
Case 2.8.
(IMPLIES (AND (NOT (LESSP D C))
(NOT (NUMBERP B))
(LESSP A 0)
(NOT (LESSP C D))
(NOT (NUMBERP C))
(NOT (EQUAL A 0))
(NUMBERP A))
(EQUAL A (DIFFERENCE (PLUS A D) 0))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.7.
(IMPLIES (AND (NOT (LESSP D C))
(NOT (NUMBERP B))
(LESSP A 0)
(NOT (LESSP C D))
(NOT (NUMBERP C))
(EQUAL A 0))
(EQUAL 0 (DIFFERENCE (PLUS A D) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.6.
(IMPLIES (AND (NOT (LESSP D C))
(NOT (NUMBERP B))
(LESSP A 0)
(NOT (LESSP C D))
(NOT (NUMBERP C))
(NOT (NUMBERP A)))
(EQUAL 0 (DIFFERENCE (PLUS A D) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.5.
(IMPLIES (AND (NOT (LESSP D C))
(NOT (NUMBERP B))
(LESSP A 0)
(NOT (LESSP C D))
(NUMBERP C)
(NOT (EQUAL A 0))
(NUMBERP A))
(EQUAL A (DIFFERENCE (PLUS A D) C))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.4.
(IMPLIES (AND (NOT (LESSP D C))
(NOT (NUMBERP B))
(LESSP A 0)
(NOT (LESSP C D))
(NUMBERP C)
(EQUAL A 0))
(EQUAL 0 (DIFFERENCE (PLUS A D) C))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (LESSP D C))
(NOT (NUMBERP B))
(LESSP A 0)
(NOT (LESSP C D))
(NUMBERP C)
(NOT (NUMBERP A)))
(EQUAL 0 (DIFFERENCE (PLUS A D) C))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.2.
(IMPLIES (AND (LESSP D C)
(LESSP A (DIFFERENCE (PLUS B C) D))
(NOT (LESSP A B))
(NOT (LESSP C D))
(LESSP (PLUS B C) D)
(NUMBERP A))
(EQUAL A
(DIFFERENCE (PLUS A D) (PLUS B C)))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (LESSP D C)
(LESSP A (DIFFERENCE (PLUS B C) D))
(NOT (LESSP A B))
(NOT (LESSP C D))
(LESSP (PLUS B C) D)
(NOT (NUMBERP A)))
(EQUAL 0
(DIFFERENCE (PLUS A D) (PLUS B C)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (LESSP (PLUS A D) (PLUS B C))
(NOT (LESSP A B))
(NOT (LESSP C D)))
(EQUAL (DIFFERENCE A
(PLUS B (DIFFERENCE C D)))
(DIFFERENCE (PLUS A D) (PLUS B C)))),
which again simplifies, rewriting with PLUS-ZERO-ARG2 and
PLUS-DIFFERENCE-ARG2, and opening up the function ZEROP, to the following
three new conjectures:
Case 1.3.
(IMPLIES (AND (LESSP (PLUS A D) (PLUS B C))
(NOT (LESSP A B))
(NOT (LESSP C D))
(NOT (LESSP D C))
(NUMBERP B))
(EQUAL (DIFFERENCE A B)
(DIFFERENCE (PLUS A D) (PLUS B C)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (LESSP (PLUS A D) (PLUS B C))
(NOT (LESSP A B))
(NOT (LESSP C D))
(NOT (LESSP D C))
(NOT (NUMBERP B)))
(EQUAL (DIFFERENCE A 0)
(DIFFERENCE (PLUS A D) (PLUS B C)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (LESSP (PLUS A D) (PLUS B C))
(NOT (LESSP A B))
(NOT (LESSP C D))
(LESSP D C))
(EQUAL (DIFFERENCE A
(DIFFERENCE (PLUS B C) D))
(DIFFERENCE (PLUS A D) (PLUS B C)))),
which again simplifies, applying DIFF-DIFF-ARG2, to the following two new
formulas:
Case 1.1.2.
(IMPLIES (AND (LESSP (PLUS A D) (PLUS B C))
(NOT (LESSP A B))
(NOT (LESSP C D))
(LESSP D C)
(LESSP (PLUS B C) D)
(NUMBERP A))
(EQUAL A
(DIFFERENCE (PLUS A D) (PLUS B C)))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.1.1.
(IMPLIES (AND (LESSP (PLUS A D) (PLUS B C))
(NOT (LESSP A B))
(NOT (LESSP C D))
(LESSP D C)
(LESSP (PLUS B C) D)
(NOT (NUMBERP A)))
(EQUAL 0
(DIFFERENCE (PLUS A D) (PLUS B C)))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFF-DIFF-DIFF
(DISABLE DIFF-DIFF-DIFF)
[ 0.0 0.0 0.0 ]
DIFF-DIFF-DIFF-OFF
(LEMMA DIFFERENCE-LESSP-ARG1
(REWRITE)
(IMPLIES (LESSP A B)
(EQUAL (DIFFERENCE A B) 0)))
Give the conjecture the name *1.
We will try to prove it by induction. There are four plausible
inductions. However, they merge into one likely candidate induction. We will
induct according to the following scheme:
(AND (IMPLIES (OR (EQUAL B 0) (NOT (NUMBERP B)))
(p A B))
(IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(OR (EQUAL A 0) (NOT (NUMBERP A))))
(p A B))
(IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(p (SUB1 A) (SUB1 B)))
(p A B))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT inform us that the measure (COUNT A) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for B. The above induction scheme
generates four new goals:
Case 4. (IMPLIES (AND (OR (EQUAL B 0) (NOT (NUMBERP B)))
(LESSP A B))
(EQUAL (DIFFERENCE A B) 0)),
which simplifies, expanding NOT, OR, EQUAL, and LESSP, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(OR (EQUAL A 0) (NOT (NUMBERP A)))
(LESSP A B))
(EQUAL (DIFFERENCE A B) 0)),
which simplifies, opening up the functions NOT, OR, EQUAL, LESSP, and
DIFFERENCE, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (LESSP (SUB1 A) (SUB1 B)))
(LESSP A B))
(EQUAL (DIFFERENCE A B) 0)),
which simplifies, using linear arithmetic, to the formula:
(IMPLIES (AND (LESSP A 1)
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (LESSP (SUB1 A) (SUB1 B)))
(LESSP A B))
(EQUAL (DIFFERENCE A B) 0)).
But this again simplifies, unfolding the functions SUB1, NUMBERP, EQUAL,
LESSP, NOT, and OR, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(EQUAL (DIFFERENCE (SUB1 A) (SUB1 B))
0)
(LESSP A B))
(EQUAL (DIFFERENCE A B) 0)),
which simplifies, using linear arithmetic, to two new goals:
Case 1.2.
(IMPLIES (AND (LESSP (SUB1 A) (SUB1 B))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(EQUAL (DIFFERENCE (SUB1 A) (SUB1 B))
0)
(LESSP A B))
(EQUAL (DIFFERENCE A B) 0)),
which again simplifies, expanding NOT, OR, LESSP, DIFFERENCE, and EQUAL,
to:
T.
Case 1.1.
(IMPLIES (AND (LESSP A 1)
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(EQUAL (DIFFERENCE (SUB1 A) (SUB1 B))
0)
(LESSP A B))
(EQUAL (DIFFERENCE A B) 0)),
which again simplifies, unfolding SUB1, NUMBERP, EQUAL, LESSP, NOT, and OR,
to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-LESSP-ARG1
(DISABLE DIFFERENCE-LESSP-ARG1)
[ 0.0 0.0 0.0 ]
DIFFERENCE-LESSP-ARG1-OFF
(DEFN PLUS-FRINGE
(X)
(IF (AND (LISTP X) (EQUAL (CAR X) 'PLUS))
(APPEND (PLUS-FRINGE (CADR X))
(PLUS-FRINGE (CADDR X)))
(CONS X NIL)))
Linear arithmetic, the lemmas CAR-LESSEQP, CDR-LESSEQP, and CDR-LESSP,
and the definition of AND establish that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each recursive call. Hence,
PLUS-FRINGE is accepted under the principle of definition. Note that
(LISTP (PLUS-FRINGE X)) is a theorem.
[ 0.0 0.0 0.0 ]
PLUS-FRINGE
(DEFN PLUS-TREE
(L)
(IF (NLISTP L)
''0
(IF (NLISTP (CDR L))
(LIST 'FIX (CAR L))
(IF (NLISTP (CDDR L))
(LIST 'PLUS (CAR L) (CADR L))
(LIST 'PLUS
(CAR L)
(PLUS-TREE (CDR L)))))))
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT L) decreases according
to the well-founded relation LESSP in each recursive call. Hence, PLUS-TREE
is accepted under the principle of definition. Note that
(LISTP (PLUS-TREE L)) is a theorem.
[ 0.0 0.0 0.0 ]
PLUS-TREE
(LEMMA NUMBERP-EVAL$-PLUS
(REWRITE)
(IMPLIES (AND (LISTP X) (EQUAL (CAR X) 'PLUS))
(NUMBERP (EVAL$ T X A))))
.
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate (CAR X)
and (CDR X). This produces:
(IMPLIES (EQUAL Z 'PLUS)
(NUMBERP (EVAL$ T (CONS Z V) A))),
which simplifies, applying REWRITE-EVAL$, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NUMBERP-EVAL$-PLUS
(DISABLE NUMBERP-EVAL$-PLUS)
[ 0.0 0.0 0.0 ]
NUMBERP-EVAL$-PLUS-OFF
(LEMMA NUMBERP-EVAL$-PLUS-TREE
(REWRITE)
(NUMBERP (EVAL$ T (PLUS-TREE L) A))
((ENABLE PLUS-TREE)))
Call the conjecture *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP L) (p L A))
(IMPLIES (AND (NOT (NLISTP L))
(NLISTP (CDR L)))
(p L A))
(IMPLIES (AND (NOT (NLISTP L))
(NOT (NLISTP (CDR L)))
(NLISTP (CDDR L)))
(p L A))
(IMPLIES (AND (NOT (NLISTP L))
(NOT (NLISTP (CDR L)))
(NOT (NLISTP (CDDR L)))
(p (CDR L) A))
(p L A))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to establish that the measure (COUNT L) decreases according
to the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme generates the following four new formulas:
Case 4. (IMPLIES (NLISTP L)
(NUMBERP (EVAL$ T (PLUS-TREE L) A))).
This simplifies, expanding the definitions of NLISTP, PLUS-TREE, CDR, CAR,
LISTP, LITATOM, EQUAL, EVAL$, and NUMBERP, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP L))
(NLISTP (CDR L)))
(NUMBERP (EVAL$ T (PLUS-TREE L) A))).
This simplifies, appealing to the lemmas REWRITE-EVAL$ and CAR-CONS, and
opening up NLISTP, PLUS-TREE, and FIX, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP L))
(NOT (NLISTP (CDR L)))
(NLISTP (CDDR L)))
(NUMBERP (EVAL$ T (PLUS-TREE L) A))).
This simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, and CDR-CONS, and
unfolding the definitions of NLISTP and PLUS-TREE, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP L))
(NOT (NLISTP (CDR L)))
(NOT (NLISTP (CDDR L)))
(NUMBERP (EVAL$ T (PLUS-TREE (CDR L)) A)))
(NUMBERP (EVAL$ T (PLUS-TREE L) A))),
which simplifies, applying REWRITE-EVAL$, CAR-CONS, and CDR-CONS, and
expanding the functions NLISTP and PLUS-TREE, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.2 ]
NUMBERP-EVAL$-PLUS-TREE
(DISABLE NUMBERP-EVAL$-PLUS-TREE)
[ 0.0 0.0 0.0 ]
NUMBERP-EVAL$-PLUS-TREE-OFF
(LEMMA MEMBER-IMPLIES-PLUS-TREE-GREATEREQP
(REWRITE)
(IMPLIES (MEMBER X Y)
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T X A))))
((ENABLE PLUS-TREE PLUS-ZERO-ARG2)))
WARNING: When the linear lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP is stored
under (EVAL$ T (PLUS-TREE Y) A) it contains the free variable X which will be
chosen by instantiating the hypothesis (MEMBER X Y).
WARNING: When the linear lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP is stored
under (EVAL$ T X A) it contains the free variable Y which will be chosen by
instantiating the hypothesis (MEMBER X Y).
WARNING: Note that the proposed lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP is
to be stored as zero type prescription rules, zero compound recognizer rules,
two linear rules, and zero replacement rules.
Give the conjecture the name *1.
We will appeal to induction. Three inductions are suggested by terms in
the conjecture. They merge into two likely candidate inductions. However,
only one is unflawed. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP Y) (p Y A X))
(IMPLIES (AND (NOT (NLISTP Y))
(EQUAL X (CAR Y)))
(p Y A X))
(IMPLIES (AND (NOT (NLISTP Y))
(NOT (EQUAL X (CAR Y)))
(p (CDR Y) A X))
(p Y A X))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to establish that the measure (COUNT Y) decreases according
to the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme leads to four new goals:
Case 4. (IMPLIES (AND (NLISTP Y) (MEMBER X Y))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T X A)))),
which simplifies, unfolding the functions NLISTP and MEMBER, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP Y))
(EQUAL X (CAR Y))
(MEMBER X Y))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T X A)))),
which simplifies, opening up NLISTP, MEMBER, and PLUS-TREE, to three new
formulas:
Case 3.3.
(IMPLIES (AND (LISTP Y) (NOT (LISTP (CDR Y))))
(NOT (LESSP (EVAL$ T (LIST 'FIX (CAR Y)) A)
(EVAL$ T (CAR Y) A)))),
which again simplifies, rewriting with the lemmas REWRITE-EVAL$ and
CAR-CONS, and expanding FIX, to two new goals:
Case 3.3.2.
(IMPLIES (AND (LISTP Y)
(NOT (LISTP (CDR Y)))
(NOT (NUMBERP (EVAL$ T (CAR Y) A))))
(NOT (LESSP 0 (EVAL$ T (CAR Y) A)))),
which again simplifies, opening up the function LESSP, to:
T.
Case 3.3.1.
(IMPLIES (AND (LISTP Y)
(NOT (LISTP (CDR Y)))
(NUMBERP (EVAL$ T (CAR Y) A)))
(NOT (LESSP (EVAL$ T (CAR Y) A)
(EVAL$ T (CAR Y) A)))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.2.
(IMPLIES (AND (LISTP Y)
(LISTP (CDR Y))
(LISTP (CDDR Y)))
(NOT (LESSP (EVAL$ T
(LIST 'PLUS
(CAR Y)
(PLUS-TREE (CDR Y)))
A)
(EVAL$ T (CAR Y) A)))),
which again simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, to the new conjecture:
(IMPLIES (AND (LISTP Y)
(LISTP (CDR Y))
(LISTP (CDDR Y)))
(NOT (LESSP (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T (CAR Y) A)))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES (AND (LISTP Y)
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y))))
(NOT (LESSP (EVAL$ T
(LIST 'PLUS (CAR Y) (CADR Y))
A)
(EVAL$ T (CAR Y) A)))),
which again simplifies, applying REWRITE-EVAL$, CAR-CONS, and CDR-CONS, to:
(IMPLIES (AND (LISTP Y)
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y))))
(NOT (LESSP (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T (CAR Y) A)))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP Y))
(NOT (EQUAL X (CAR Y)))
(NOT (MEMBER X (CDR Y)))
(MEMBER X Y))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T X A)))),
which simplifies, unfolding the functions NLISTP and MEMBER, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP Y))
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X Y))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T X A)))),
which simplifies, opening up NLISTP, MEMBER, and PLUS-TREE, to three new
formulas:
Case 1.3.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y))))
(NOT (LESSP (EVAL$ T (LIST 'FIX (CAR Y)) A)
(EVAL$ T X A)))),
which again simplifies, applying the lemmas REWRITE-EVAL$ and CAR-CONS,
and opening up the definition of FIX, to two new conjectures:
Case 1.3.2.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y)))
(NOT (NUMBERP (EVAL$ T (CAR Y) A))))
(NOT (LESSP 0 (EVAL$ T X A)))),
which again simplifies, expanding the functions EQUAL and LESSP, to:
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y)))
(NOT (NUMBERP (EVAL$ T (CAR Y) A)))
(NOT (EQUAL (EVAL$ T X A) 0)))
(NOT (NUMBERP (EVAL$ T X A)))).
This further simplifies, expanding the definitions of PLUS-TREE, CDR,
CAR, LISTP, LITATOM, EQUAL, EVAL$, and LESSP, to:
T.
Case 1.3.1.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y)))
(NUMBERP (EVAL$ T (CAR Y) A)))
(NOT (LESSP (EVAL$ T (CAR Y) A)
(EVAL$ T X A)))),
which further simplifies, expanding PLUS-TREE, CDR, CAR, LISTP, LITATOM,
EQUAL, EVAL$, LESSP, and MEMBER, to:
T.
Case 1.2.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y)))
(NOT (LESSP (EVAL$ T
(LIST 'PLUS
(CAR Y)
(PLUS-TREE (CDR Y)))
A)
(EVAL$ T X A)))),
which again simplifies, applying REWRITE-EVAL$, CAR-CONS, and CDR-CONS, to:
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y)))
(NOT (LESSP (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y))))
(NOT (LESSP (EVAL$ T
(LIST 'PLUS (CAR Y) (CADR Y))
A)
(EVAL$ T X A)))),
which again simplifies, applying REWRITE-EVAL$, CAR-CONS, and CDR-CONS, to
the new conjecture:
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y))))
(NOT (LESSP (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))),
which further simplifies, rewriting with the lemmas REWRITE-EVAL$,
CAR-CONS, and PLUS-ZERO-ARG2, and opening up the functions PLUS-TREE, FIX,
and ZEROP, to two new conjectures:
Case 1.1.2.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CADR Y) A)))
(NOT (LESSP 0 (EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NUMBERP (EVAL$ T (CAR Y) A)))
(NOT (LESSP (EVAL$ T (CAR Y) A)
(EVAL$ T X A)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.1.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NUMBERP (EVAL$ T (CADR Y) A))
(NOT (LESSP (EVAL$ T (CADR Y) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y))))
(NOT (LESSP (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 1.3 0.0 ]
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP
(DISABLE MEMBER-IMPLIES-PLUS-TREE-GREATEREQP)
[ 0.0 0.0 0.0 ]
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP-OFF
(LEMMA PLUS-TREE-DELETE
(REWRITE)
(EQUAL (EVAL$ T (PLUS-TREE (DELETE X Y)) A)
(IF (MEMBER X Y)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T X A))
(EVAL$ T (PLUS-TREE Y) A)))
((ENABLE DELETE PLUS-TREE DELETE-NON-MEMBER
DIFFERENCE-PLUS-CANCELLATION EQUAL-DIFFERENCE-0 EQUAL-PLUS-0
LISTP-DELETE MEMBER-IMPLIES-PLUS-TREE-GREATEREQP
NUMBERP-EVAL$-PLUS-TREE PLUS-ZERO-ARG2)))
This simplifies, clearly, to the following two new formulas:
Case 2. (IMPLIES (NOT (MEMBER X Y))
(EQUAL (EVAL$ T (PLUS-TREE (DELETE X Y)) A)
(EVAL$ T (PLUS-TREE Y) A))).
But this again simplifies, rewriting with DELETE-NON-MEMBER, to:
T.
Case 1. (IMPLIES (MEMBER X Y)
(EQUAL (EVAL$ T (PLUS-TREE (DELETE X Y)) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T X A)))).
Name the above subgoal *1.
We will appeal to induction. There are four plausible inductions. They
merge into two likely candidate inductions. However, only one is unflawed.
We will induct according to the following scheme:
(AND (IMPLIES (NLISTP Y) (p X Y A))
(IMPLIES (AND (NOT (NLISTP Y))
(EQUAL X (CAR Y)))
(p X Y A))
(IMPLIES (AND (NOT (NLISTP Y))
(NOT (EQUAL X (CAR Y)))
(p X (CDR Y) A))
(p X Y A))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to show that the measure (COUNT Y) decreases according to
the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme generates four new conjectures:
Case 4. (IMPLIES (AND (NLISTP Y) (MEMBER X Y))
(EQUAL (EVAL$ T (PLUS-TREE (DELETE X Y)) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T X A)))),
which simplifies, opening up the functions NLISTP and MEMBER, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP Y))
(EQUAL X (CAR Y))
(MEMBER X Y))
(EQUAL (EVAL$ T (PLUS-TREE (DELETE X Y)) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T X A)))),
which simplifies, opening up the definitions of NLISTP, MEMBER, DELETE, and
PLUS-TREE, to three new conjectures:
Case 3.3.
(IMPLIES (AND (LISTP Y) (NOT (LISTP (CDR Y))))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
(DIFFERENCE (EVAL$ T (LIST 'FIX (CAR Y)) A)
(EVAL$ T (CAR Y) A)))),
which again simplifies, applying the lemmas REWRITE-EVAL$ and CAR-CONS,
and opening up the definition of FIX, to two new formulas:
Case 3.3.2.
(IMPLIES (AND (LISTP Y)
(NOT (LISTP (CDR Y)))
(NOT (NUMBERP (EVAL$ T (CAR Y) A))))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
(DIFFERENCE 0 (EVAL$ T (CAR Y) A)))),
which again simplifies, expanding the functions EQUAL and DIFFERENCE, to:
(IMPLIES (AND (LISTP Y)
(NOT (LISTP (CDR Y)))
(NOT (NUMBERP (EVAL$ T (CAR Y) A))))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
0)).
But this further simplifies, opening up the definitions of PLUS-TREE,
CDR, CAR, LISTP, LITATOM, EQUAL, and EVAL$, to:
T.
Case 3.3.1.
(IMPLIES (AND (LISTP Y)
(NOT (LISTP (CDR Y)))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
(DIFFERENCE (EVAL$ T (CAR Y) A)
(EVAL$ T (CAR Y) A)))),
which further simplifies, rewriting with EQUAL-DIFFERENCE-0, and
unfolding the definitions of PLUS-TREE, CDR, CAR, LISTP, LITATOM, EQUAL,
and EVAL$, to:
(IMPLIES (AND (LISTP Y)
(NOT (LISTP (CDR Y)))
(NUMBERP (EVAL$ T (CAR Y) A)))
(NOT (LESSP (EVAL$ T (CAR Y) A)
(EVAL$ T (CAR Y) A)))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.2.
(IMPLIES (AND (LISTP Y)
(LISTP (CDR Y))
(LISTP (CDDR Y)))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
(DIFFERENCE (EVAL$ T
(LIST 'PLUS
(CAR Y)
(PLUS-TREE (CDR Y)))
A)
(EVAL$ T (CAR Y) A)))),
which again simplifies, applying REWRITE-EVAL$, CAR-CONS, CDR-CONS,
NUMBERP-EVAL$-PLUS-TREE, and DIFFERENCE-PLUS-CANCELLATION, to:
T.
Case 3.1.
(IMPLIES (AND (LISTP Y)
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y))))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
(DIFFERENCE (EVAL$ T
(LIST 'PLUS (CAR Y) (CADR Y))
A)
(EVAL$ T (CAR Y) A)))).
However this again simplifies, appealing to the lemmas REWRITE-EVAL$,
CAR-CONS, CDR-CONS, and DIFFERENCE-PLUS-CANCELLATION, to two new goals:
Case 3.1.2.
(IMPLIES (AND (LISTP Y)
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (NUMBERP (EVAL$ T (CADR Y) A))))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
0)),
which further simplifies, applying REWRITE-EVAL$ and CAR-CONS, and
opening up the functions PLUS-TREE, FIX, and EQUAL, to:
T.
Case 3.1.1.
(IMPLIES (AND (LISTP Y)
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NUMBERP (EVAL$ T (CADR Y) A)))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T (CADR Y) A))).
But this further simplifies, rewriting with REWRITE-EVAL$ and CAR-CONS,
and unfolding PLUS-TREE and FIX, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP Y))
(NOT (EQUAL X (CAR Y)))
(NOT (MEMBER X (CDR Y)))
(MEMBER X Y))
(EQUAL (EVAL$ T (PLUS-TREE (DELETE X Y)) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T X A)))).
This simplifies, unfolding NLISTP and MEMBER, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP Y))
(NOT (EQUAL X (CAR Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X Y))
(EQUAL (EVAL$ T (PLUS-TREE (DELETE X Y)) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T X A)))).
This simplifies, rewriting with CAR-CONS, LISTP-DELETE, and CDR-CONS, and
expanding the functions NLISTP, MEMBER, DELETE, and PLUS-TREE, to six new
formulas:
Case 1.6.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y))))
(EQUAL (EVAL$ T (LIST 'FIX (CAR Y)) A)
(DIFFERENCE (EVAL$ T (LIST 'FIX (CAR Y)) A)
(EVAL$ T X A)))),
which again simplifies, rewriting with LISTP-DELETE, EQUAL-DIFFERENCE-0,
REWRITE-EVAL$, and CAR-CONS, and opening up the functions PLUS-TREE, CDR,
CAR, LISTP, LITATOM, EQUAL, EVAL$, and FIX, to the following two new
conjectures:
Case 1.6.2.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (PLUS-TREE (CDR Y)) A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y)))
(NOT (NUMBERP (EVAL$ T (CAR Y) A))))
(EQUAL 0
(DIFFERENCE 0 (EVAL$ T X A)))).
However this again simplifies, using linear arithmetic and applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to the following three new formulas:
Case 1.6.2.3.
(IMPLIES (AND (NOT (NUMBERP (EVAL$ T (PLUS-TREE (CDR Y)) A)))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (PLUS-TREE (CDR Y)) A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y)))
(NOT (NUMBERP (EVAL$ T (CAR Y) A))))
(EQUAL 0
(DIFFERENCE 0 (EVAL$ T X A)))).
But this again simplifies, using linear arithmetic and rewriting with
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:
(IMPLIES (AND (LESSP 0 (EVAL$ T X A))
(NOT (NUMBERP (EVAL$ T (PLUS-TREE (CDR Y)) A)))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (PLUS-TREE (CDR Y)) A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y)))
(NOT (NUMBERP (EVAL$ T (CAR Y) A))))
(EQUAL 0
(DIFFERENCE 0 (EVAL$ T X A)))),
which again simplifies, using linear arithmetic and applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:
T.
Case 1.6.2.2.
(IMPLIES (AND (NOT (NUMBERP (EVAL$ T X A)))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (PLUS-TREE (CDR Y)) A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y)))
(NOT (NUMBERP (EVAL$ T (CAR Y) A))))
(EQUAL 0
(DIFFERENCE 0 (EVAL$ T X A)))).
But this again simplifies, rewriting with NUMBERP-EVAL$-PLUS-TREE, and
unfolding the functions LESSP, EQUAL, and DIFFERENCE, to:
T.
Case 1.6.2.1.
(IMPLIES (AND (NUMBERP (EVAL$ T X A))
(NUMBERP (EVAL$ T (PLUS-TREE (CDR Y)) A))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T X A) (EVAL$ T X A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y)))
(NOT (NUMBERP (EVAL$ T (CAR Y) A))))
(EQUAL 0
(DIFFERENCE 0 (EVAL$ T X A)))).
This again simplifies, unfolding EQUAL and DIFFERENCE, to:
T.
Case 1.6.1.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (PLUS-TREE (CDR Y)) A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y)))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (EVAL$ T (CAR Y) A)
(EVAL$ T X A)))),
which again simplifies, using linear arithmetic and rewriting with the
lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to three new conjectures:
Case 1.6.1.3.
(IMPLIES (AND (NOT (NUMBERP (EVAL$ T (PLUS-TREE (CDR Y)) A)))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (PLUS-TREE (CDR Y)) A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y)))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (EVAL$ T (CAR Y) A)
(EVAL$ T X A)))),
which again simplifies, using linear arithmetic and applying the lemma
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to the goal:
(IMPLIES (AND (LESSP (EVAL$ T (CAR Y) A)
(EVAL$ T X A))
(NOT (NUMBERP (EVAL$ T (PLUS-TREE (CDR Y)) A)))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (PLUS-TREE (CDR Y)) A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y)))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (EVAL$ T (CAR Y) A)
(EVAL$ T X A)))).
However this again simplifies, using linear arithmetic and rewriting
with the lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:
T.
Case 1.6.1.2.
(IMPLIES (AND (NOT (NUMBERP (EVAL$ T X A)))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (PLUS-TREE (CDR Y)) A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y)))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (EVAL$ T (CAR Y) A)
(EVAL$ T X A)))),
which again simplifies, rewriting with the lemma
NUMBERP-EVAL$-PLUS-TREE, and opening up the functions LESSP and
DIFFERENCE, to:
T.
Case 1.6.1.1.
(IMPLIES (AND (NUMBERP (EVAL$ T X A))
(NUMBERP (EVAL$ T (PLUS-TREE (CDR Y)) A))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T X A) (EVAL$ T X A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y)))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (EVAL$ T (CAR Y) A)
(EVAL$ T X A)))),
which again simplifies, trivially, to the new formula:
(IMPLIES (AND (NUMBERP (EVAL$ T X A))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T X A) (EVAL$ T X A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y)))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (EVAL$ T (CAR Y) A)
(EVAL$ T X A)))),
which further simplifies, using linear arithmetic, rewriting with
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, and opening up EVAL$, EQUAL,
LITATOM, LISTP, CAR, CDR, and PLUS-TREE, to the new conjecture:
(IMPLIES (AND (LESSP (EVAL$ T (CAR Y) A)
(EVAL$ T X A))
(NUMBERP (EVAL$ T X A))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (LESSP (EVAL$ T X A) (EVAL$ T X A)))
(MEMBER X (CDR Y))
(NOT (LISTP (CDR Y)))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (EVAL$ T (CAR Y) A)
(EVAL$ T X A)))),
which finally simplifies, using linear arithmetic, appealing to the
lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, and unfolding the functions
EVAL$, EQUAL, LITATOM, LISTP, CAR, CDR, and PLUS-TREE, to:
T.
Case 1.5.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y))
(LISTP (CDR (DELETE X (CDR Y)))))
(EQUAL (EVAL$ T
(LIST 'PLUS
(CAR Y)
(PLUS-TREE (DELETE X (CDR Y))))
A)
(DIFFERENCE (EVAL$ T
(LIST 'PLUS
(CAR Y)
(PLUS-TREE (CDR Y)))
A)
(EVAL$ T X A)))),
which again simplifies, applying REWRITE-EVAL$, CAR-CONS, and CDR-CONS, to
the new formula:
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y))
(LISTP (CDR (DELETE X (CDR Y)))))
(EQUAL (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A))
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A)))),
which again simplifies, using linear arithmetic, to two new conjectures:
Case 1.5.2.
(IMPLIES (AND (LESSP (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y))
(LISTP (CDR (DELETE X (CDR Y)))))
(EQUAL (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A))
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A)))),
which again simplifies, using linear arithmetic and appealing to the
lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:
T.
Case 1.5.1.
(IMPLIES (AND (LESSP (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y))
(LISTP (CDR (DELETE X (CDR Y)))))
(EQUAL (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A))
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A)))),
which again simplifies, using linear arithmetic, to the goal:
(IMPLIES (AND (LESSP (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A))
(LESSP (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y))
(LISTP (CDR (DELETE X (CDR Y)))))
(EQUAL (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A))
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A)))).
However this again simplifies, using linear arithmetic and applying the
lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:
T.
Case 1.4.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y))
(NOT (LISTP (CDR (DELETE X (CDR Y))))))
(EQUAL (EVAL$ T
(LIST 'PLUS
(CAR Y)
(CAR (DELETE X (CDR Y))))
A)
(DIFFERENCE (EVAL$ T
(LIST 'PLUS
(CAR Y)
(PLUS-TREE (CDR Y)))
A)
(EVAL$ T X A)))),
which again simplifies, rewriting with LISTP-DELETE, REWRITE-EVAL$,
CAR-CONS, CDR-CONS, and PLUS-ZERO-ARG2, and expanding the definitions of
PLUS-TREE, FIX, and ZEROP, to the following three new goals:
Case 1.4.3.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(EQUAL 0
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NOT (NUMBERP (EVAL$ T (CAR Y) A))))
(EQUAL 0
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A)))).
But this again simplifies, applying the lemmas EQUAL-DIFFERENCE-0 and
NUMBERP-EVAL$-PLUS-TREE, and opening up the definition of PLUS, to:
T.
Case 1.4.2.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(EQUAL 0
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A)))),
which again simplifies, using linear arithmetic, to two new formulas:
Case 1.4.2.2.
(IMPLIES
(AND (LESSP (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(EQUAL 0
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A)))),
which again simplifies, using linear arithmetic and appealing to the
lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:
T.
Case 1.4.2.1.
(IMPLIES
(AND (LESSP (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(EQUAL 0
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A)))),
which again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES
(AND (LESSP (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A))
(LESSP (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(EQUAL 0
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A)))).
However this again simplifies, using linear arithmetic and applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:
T.
Case 1.4.1.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A))
(EQUAL (EVAL$ T (CAR (DELETE X (CDR Y))) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y))
(NOT (LISTP (CDR (DELETE X (CDR Y))))))
(EQUAL (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CAR (DELETE X (CDR Y))) A))
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A)))).
However this again simplifies, using linear arithmetic, to two new
conjectures:
Case 1.4.1.2.
(IMPLIES
(AND (LESSP (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A))
(EQUAL (EVAL$ T (CAR (DELETE X (CDR Y))) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y))
(NOT (LISTP (CDR (DELETE X (CDR Y))))))
(EQUAL (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CAR (DELETE X (CDR Y))) A))
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A)))),
which again simplifies, using linear arithmetic and rewriting with
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:
T.
Case 1.4.1.1.
(IMPLIES
(AND (LESSP (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A))
(EQUAL (EVAL$ T (CAR (DELETE X (CDR Y))) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y))
(NOT (LISTP (CDR (DELETE X (CDR Y))))))
(EQUAL (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CAR (DELETE X (CDR Y))) A))
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A)))).
This again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (LESSP (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A))
(LESSP (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A))
(EQUAL (EVAL$ T (CAR (DELETE X (CDR Y))) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(LISTP (CDDR Y))
(NOT (LISTP (CDR (DELETE X (CDR Y))))))
(EQUAL (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CAR (DELETE X (CDR Y))) A))
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (PLUS-TREE (CDR Y)) A))
(EVAL$ T X A)))).
However this again simplifies, using linear arithmetic and rewriting
with MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:
T.
Case 1.3.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(LISTP (CDR (DELETE X (CDR Y)))))
(EQUAL (EVAL$ T
(LIST 'PLUS
(CAR Y)
(PLUS-TREE (DELETE X (CDR Y))))
A)
(DIFFERENCE (EVAL$ T
(LIST 'PLUS (CAR Y) (CADR Y))
A)
(EVAL$ T X A)))).
But this again simplifies, rewriting with the lemmas REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, to:
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(LISTP (CDR (DELETE X (CDR Y)))))
(EQUAL (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A))
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))).
This further simplifies, appealing to the lemmas CONS-CAR-CDR,
DELETE-NON-MEMBER, REWRITE-EVAL$, and CAR-CONS, and unfolding the
functions MEMBER, DELETE, PLUS-TREE, and FIX, to:
T.
Case 1.2.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y))))))
(EQUAL (EVAL$ T
(LIST 'PLUS
(CAR Y)
(CAR (DELETE X (CDR Y))))
A)
(DIFFERENCE (EVAL$ T
(LIST 'PLUS (CAR Y) (CADR Y))
A)
(EVAL$ T X A)))),
which again simplifies, rewriting with LISTP-DELETE, REWRITE-EVAL$,
CAR-CONS, CDR-CONS, and PLUS-ZERO-ARG2, and expanding PLUS-TREE, FIX, and
ZEROP, to the following three new formulas:
Case 1.2.3.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(EQUAL 0
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NOT (NUMBERP (EVAL$ T (CAR Y) A))))
(EQUAL 0
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))).
But this again simplifies, applying EQUAL-DIFFERENCE-0, and expanding
PLUS, to the following two new formulas:
Case 1.2.3.2.
(IMPLIES
(AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (PLUS-TREE (CDR Y)) A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NOT (NUMBERP (EVAL$ T (CAR Y) A)))
(NOT (NUMBERP (EVAL$ T (CADR Y) A))))
(NOT (LESSP (EVAL$ T X A) 0))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.2.3.1.
(IMPLIES
(AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (PLUS-TREE (CDR Y)) A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NOT (NUMBERP (EVAL$ T (CAR Y) A)))
(NUMBERP (EVAL$ T (CADR Y) A)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (CADR Y) A)))),
which again simplifies, using linear arithmetic and rewriting with
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to the following three new goals:
Case 1.2.3.1.3.
(IMPLIES
(AND (NOT (NUMBERP (EVAL$ T (PLUS-TREE (CDR Y)) A)))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (PLUS-TREE (CDR Y)) A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NOT (NUMBERP (EVAL$ T (CAR Y) A)))
(NUMBERP (EVAL$ T (CADR Y) A)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (CADR Y) A)))).
However this again simplifies, applying NUMBERP-EVAL$-PLUS-TREE, to:
T.
Case 1.2.3.1.2.
(IMPLIES
(AND (NOT (NUMBERP (EVAL$ T X A)))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (PLUS-TREE (CDR Y)) A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NOT (NUMBERP (EVAL$ T (CAR Y) A)))
(NUMBERP (EVAL$ T (CADR Y) A)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (CADR Y) A)))).
However this again simplifies, rewriting with
NUMBERP-EVAL$-PLUS-TREE, and unfolding the function LESSP, to:
(IMPLIES
(AND (NOT (NUMBERP (EVAL$ T X A)))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
0)
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NOT (NUMBERP (EVAL$ T (CAR Y) A)))
(NUMBERP (EVAL$ T (CADR Y) A)))
(EQUAL (EVAL$ T (CADR Y) A) 0)),
which finally simplifies, applying the lemmas CONS-CAR-CDR and
DELETE-NON-MEMBER, and expanding the definitions of MEMBER and
DELETE, to:
T.
Case 1.2.3.1.1.
(IMPLIES
(AND (NUMBERP (EVAL$ T X A))
(NUMBERP (EVAL$ T (PLUS-TREE (CDR Y)) A))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(NOT (LESSP (EVAL$ T X A) (EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NOT (NUMBERP (EVAL$ T (CAR Y) A)))
(NUMBERP (EVAL$ T (CADR Y) A)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (CADR Y) A)))),
which again simplifies, trivially, to the new goal:
(IMPLIES
(AND (NUMBERP (EVAL$ T X A))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(NOT (LESSP (EVAL$ T X A) (EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NOT (NUMBERP (EVAL$ T (CAR Y) A)))
(NUMBERP (EVAL$ T (CADR Y) A)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (CADR Y) A)))),
which finally simplifies, rewriting with REWRITE-EVAL$, CAR-CONS,
CONS-CAR-CDR, and DELETE-NON-MEMBER, and opening up the definitions
of PLUS-TREE, FIX, MEMBER, and DELETE, to:
T.
Case 1.2.2.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(EQUAL 0
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))).
This again simplifies, rewriting with EQUAL-DIFFERENCE-0, to:
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (PLUS-TREE (CDR Y)) A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))),
which again simplifies, using linear arithmetic and rewriting with
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to the following three new formulas:
Case 1.2.2.3.
(IMPLIES
(AND (NOT (NUMBERP (EVAL$ T (PLUS-TREE (CDR Y)) A)))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (PLUS-TREE (CDR Y)) A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))).
But this again simplifies, appealing to the lemma
NUMBERP-EVAL$-PLUS-TREE, to:
T.
Case 1.2.2.2.
(IMPLIES
(AND (NOT (NUMBERP (EVAL$ T X A)))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(NOT (LESSP (EVAL$ T X A)
(EVAL$ T (PLUS-TREE (CDR Y)) A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))),
which again simplifies, applying the lemmas NUMBERP-EVAL$-PLUS-TREE
and EQUAL-PLUS-0, and unfolding the definitions of LESSP and
DIFFERENCE, to two new goals:
Case 1.2.2.2.2.
(IMPLIES
(AND (NOT (NUMBERP (EVAL$ T X A)))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
0)
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NUMBERP (EVAL$ T (CAR Y) A))
(NOT (EQUAL (EVAL$ T (CADR Y) A) 0))
(NUMBERP (EVAL$ T (CADR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A)))),
which finally simplifies, rewriting with CONS-CAR-CDR and
DELETE-NON-MEMBER, and opening up the functions MEMBER and DELETE,
to:
T.
Case 1.2.2.2.1.
(IMPLIES
(AND (NOT (NUMBERP (EVAL$ T X A)))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
0)
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NUMBERP (EVAL$ T (CAR Y) A))
(NOT (EQUAL (EVAL$ T (CAR Y) A) 0)))
(EQUAL (EVAL$ T (CAR Y) A)
(PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A)))).
This finally simplifies, applying CONS-CAR-CDR, DELETE-NON-MEMBER,
REWRITE-EVAL$, CAR-CONS, and PLUS-ZERO-ARG2, and expanding the
functions MEMBER, DELETE, PLUS-TREE, FIX, EQUAL, and ZEROP, to:
T.
Case 1.2.2.1.
(IMPLIES
(AND (NUMBERP (EVAL$ T X A))
(NUMBERP (EVAL$ T (PLUS-TREE (CDR Y)) A))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(NOT (LESSP (EVAL$ T X A) (EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))).
This again simplifies, trivially, to:
(IMPLIES
(AND (NUMBERP (EVAL$ T X A))
(EQUAL (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A)))
(NOT (LESSP (EVAL$ T X A) (EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y)))))
(NUMBERP (EVAL$ T (CAR Y) A)))
(EQUAL (EVAL$ T (CAR Y) A)
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))),
which finally simplifies, rewriting with REWRITE-EVAL$, CAR-CONS,
CONS-CAR-CDR, DELETE-NON-MEMBER, and PLUS-ZERO-ARG2, and opening up
the definitions of PLUS-TREE, FIX, MEMBER, DELETE, LESSP, ZEROP, EQUAL,
and DIFFERENCE, to:
T.
Case 1.2.1.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NUMBERP (EVAL$ T (CAR (DELETE X (CDR Y))) A))
(EQUAL (EVAL$ T (CAR (DELETE X (CDR Y))) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y))))))
(EQUAL (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CAR (DELETE X (CDR Y))) A))
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))).
This again simplifies, obviously, to:
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(EQUAL (EVAL$ T (CAR (DELETE X (CDR Y))) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y)))
(NOT (LISTP (CDR (DELETE X (CDR Y))))))
(EQUAL (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CAR (DELETE X (CDR Y))) A))
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))),
which further simplifies, applying CONS-CAR-CDR, DELETE-NON-MEMBER,
REWRITE-EVAL$, and CAR-CONS, and unfolding the functions MEMBER, DELETE,
PLUS-TREE, and FIX, to:
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NUMBERP (EVAL$ T (CADR Y) A))
(EQUAL (EVAL$ T (CADR Y) A)
(DIFFERENCE (EVAL$ T (CADR Y) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y))))
(EQUAL (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))),
which again simplifies, using linear arithmetic, to two new conjectures:
Case 1.2.1.2.
(IMPLIES (AND (LESSP (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NUMBERP (EVAL$ T (CADR Y) A))
(EQUAL (EVAL$ T (CADR Y) A)
(DIFFERENCE (EVAL$ T (CADR Y) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y))))
(EQUAL (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))),
which again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES (AND (LESSP (EVAL$ T (CADR Y) A)
(EVAL$ T X A))
(LESSP (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NUMBERP (EVAL$ T (CADR Y) A))
(EQUAL (EVAL$ T (CADR Y) A)
(DIFFERENCE (EVAL$ T (CADR Y) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y))))
(EQUAL (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))).
However this finally simplifies, using linear arithmetic, rewriting
with MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, CAR-CONS, and REWRITE-EVAL$,
and opening up the functions FIX and PLUS-TREE, to:
T.
Case 1.2.1.1.
(IMPLIES (AND (LESSP (EVAL$ T (CADR Y) A)
(EVAL$ T X A))
(LISTP Y)
(NOT (EQUAL X (CAR Y)))
(NUMBERP (EVAL$ T (CADR Y) A))
(EQUAL (EVAL$ T (CADR Y) A)
(DIFFERENCE (EVAL$ T (CADR Y) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(NOT (EQUAL X (CADR Y))))
(EQUAL (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(DIFFERENCE (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))).
However this finally simplifies, using linear arithmetic, rewriting
with MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, CAR-CONS, and REWRITE-EVAL$,
and opening up the definitions of FIX and PLUS-TREE, to:
T.
Case 1.1.
(IMPLIES (AND (LISTP Y)
(NOT (EQUAL X (CAR Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (DELETE X (CDR Y)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE (CDR Y)) A)
(EVAL$ T X A)))
(MEMBER X (CDR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y)))
(EQUAL X (CADR Y)))
(EQUAL (EVAL$ T (LIST 'FIX (CAR Y)) A)
(DIFFERENCE (EVAL$ T
(LIST 'PLUS (CAR Y) (CADR Y))
A)
(EVAL$ T X A)))).
But this again simplifies, appealing to the lemmas EQUAL-DIFFERENCE-0,
REWRITE-EVAL$, CAR-CONS, CDR-CONS, and DIFFERENCE-PLUS-CANCELLATION, and
expanding the definitions of DELETE, PLUS-TREE, CDR, CAR, LISTP, LITATOM,
EQUAL, EVAL$, MEMBER, and FIX, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 16.2 0.1 ]
PLUS-TREE-DELETE
(DISABLE PLUS-TREE-DELETE)
[ 0.0 0.0 0.0 ]
PLUS-TREE-DELETE-OFF
(LEMMA SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP
(REWRITE)
(IMPLIES (SUBBAGP X Y)
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE X) A))))
((ENABLE PLUS-TREE SUBBAGP MEMBER-IMPLIES-PLUS-TREE-GREATEREQP
PLUS-TREE-DELETE PLUS-ZERO-ARG2 SUBBAGP-CDR2)))
WARNING: When the linear lemma SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP is stored
under (EVAL$ T (PLUS-TREE Y) A) it contains the free variable X which will be
chosen by instantiating the hypothesis (SUBBAGP X Y).
WARNING: When the linear lemma SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP is stored
under (EVAL$ T (PLUS-TREE X) A) it contains the free variable Y which will be
chosen by instantiating the hypothesis (SUBBAGP X Y).
WARNING: Note that the proposed lemma SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP is
to be stored as zero type prescription rules, zero compound recognizer rules,
two linear rules, and zero replacement rules.
Name the conjecture *1.
Perhaps we can prove it by induction. There are three plausible
inductions. They merge into two likely candidate inductions. However, only
one is unflawed. We will induct according to the following scheme:
(AND (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(p (DELETE (CAR X) Y) A (CDR X)))
(p Y A X))
(IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) Y)))
(p Y A X))
(IMPLIES (NOT (LISTP X)) (p Y A X))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instance chosen for Y. The above
induction scheme leads to the following four new formulas:
Case 4. (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (SUBBAGP (CDR X) (DELETE (CAR X) Y)))
(SUBBAGP X Y))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE X) A)))).
This simplifies, opening up the definition of SUBBAGP, to:
T.
Case 3. (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (LESSP (EVAL$ T
(PLUS-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(SUBBAGP X Y))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE X) A)))).
This simplifies, applying PLUS-TREE-DELETE, and unfolding SUBBAGP and
PLUS-TREE, to three new formulas:
Case 3.3.
(IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (LESSP (DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A))
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(NOT (LISTP (CDR X))))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (LIST 'FIX (CAR X)) A)))),
which again simplifies, rewriting with the lemmas REWRITE-EVAL$ and
CAR-CONS, and opening up the definition of FIX, to two new formulas:
Case 3.3.2.
(IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (LESSP (DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A))
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(NOT (LISTP (CDR X)))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.3.1.
(IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (LESSP (DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A))
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(NOT (LISTP (CDR X)))
(NUMBERP (EVAL$ T (CAR X) A)))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A)))),
which again simplifies, using linear arithmetic and applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:
T.
Case 3.2.
(IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (LESSP (DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A))
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(LISTP (CDDR X)))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T
(LIST 'PLUS
(CAR X)
(PLUS-TREE (CDR X)))
A)))).
This again simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, to:
(IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (LESSP (DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A))
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(LISTP (CDDR X)))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (PLUS-TREE (CDR X)) A))))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A))
(LISTP X)
(MEMBER (CAR X) Y)
(NOT (LESSP (DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A))
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(LISTP (CDDR X)))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (PLUS-TREE (CDR X)) A))))).
However this again simplifies, using linear arithmetic and applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:
T.
Case 3.1.
(IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (LESSP (DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A))
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(NOT (LISTP (CDDR X))))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T
(LIST 'PLUS (CAR X) (CADR X))
A)))).
This again simplifies, rewriting with the lemmas REWRITE-EVAL$, CAR-CONS,
and CDR-CONS, to:
(IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (LESSP (DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A))
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(NOT (LISTP (CDDR X))))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (CADR X) A))))).
But this further simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, and
PLUS-ZERO-ARG2, and expanding the definitions of PLUS-TREE, FIX, and ZEROP,
to the following three new formulas:
Case 3.1.3.
(IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (NUMBERP (EVAL$ T (CADR X) A)))
(NOT (LESSP (DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A))
0))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A) 0))).
However this again simplifies, using linear arithmetic, to:
T.
Case 3.1.2.
(IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (NUMBERP (EVAL$ T (CADR X) A)))
(NOT (LESSP (DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A))
0))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NUMBERP (EVAL$ T (CAR X) A)))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A)))),
which again simplifies, using linear arithmetic and applying the lemma
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:
T.
Case 3.1.1.
(IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NUMBERP (EVAL$ T (CADR X) A))
(NOT (LESSP (DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A))
(EVAL$ T (CADR X) A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(NOT (LISTP (CDDR X))))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (CADR X) A))))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A))
(LISTP X)
(MEMBER (CAR X) Y)
(NUMBERP (EVAL$ T (CADR X) A))
(NOT (LESSP (DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A))
(EVAL$ T (CADR X) A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(NOT (LISTP (CDDR X))))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (CADR X) A))))).
However this again simplifies, using linear arithmetic and applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:
T.
Case 2. (IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) Y))
(SUBBAGP X Y))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE X) A)))).
This simplifies, unfolding the definition of SUBBAGP, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP X)) (SUBBAGP X Y))
(NOT (LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE X) A)))).
This simplifies, applying SUBBAGP-CDR2, and opening up SUBBAGP, PLUS-TREE,
CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$, and LESSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 1.8 0.0 ]
SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP
(DISABLE SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP)
[ 0.0 0.0 0.0 ]
SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP-OFF
(LEMMA PLUS-TREE-BAGDIFF
(REWRITE)
(IMPLIES (SUBBAGP X Y)
(EQUAL (EVAL$ T (PLUS-TREE (BAGDIFF Y X)) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE X) A))))
((ENABLE BAGDIFF PLUS-TREE SUBBAGP COMMUTATIVITY-OF-PLUS
DIFF-DIFF-ARG1 DIFFERENCE-LESSP-ARG1
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP NUMBERP-EVAL$-PLUS-TREE
PLUS-TREE-DELETE PLUS-ZERO-ARG2 SUBBAGP-CDR2
SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP)))
Give the conjecture the name *1.
Perhaps we can prove it by induction. Four inductions are suggested by
terms in the conjecture. They merge into two likely candidate inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(p (DELETE (CAR X) Y) (CDR X) A))
(p Y X A))
(IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) Y))
(p Y (CDR X) A))
(p Y X A))
(IMPLIES (NOT (LISTP X)) (p Y X A))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instances chosen for Y. The
above induction scheme generates the following five new goals:
Case 5. (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (SUBBAGP (CDR X) (DELETE (CAR X) Y)))
(SUBBAGP X Y))
(EQUAL (EVAL$ T (PLUS-TREE (BAGDIFF Y X)) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE X) A)))).
This simplifies, unfolding the definition of SUBBAGP, to:
T.
Case 4. (IMPLIES
(AND (LISTP X)
(MEMBER (CAR X) Y)
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T
(PLUS-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(SUBBAGP X Y))
(EQUAL (EVAL$ T (PLUS-TREE (BAGDIFF Y X)) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE X) A)))).
This simplifies, rewriting with PLUS-TREE-DELETE and DIFF-DIFF-ARG1, and
expanding the functions SUBBAGP, BAGDIFF, and PLUS-TREE, to three new
conjectures:
Case 4.3.
(IMPLIES
(AND (LISTP X)
(MEMBER (CAR X) Y)
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (PLUS-TREE (CDR X)) A))))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(NOT (LISTP (CDR X))))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (LIST 'FIX (CAR X)) A)))),
which again simplifies, applying the lemmas REWRITE-EVAL$ and CAR-CONS,
and expanding FIX, to two new goals:
Case 4.3.2.
(IMPLIES
(AND
(LISTP X)
(MEMBER (CAR X) Y)
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (PLUS-TREE (CDR X)) A))))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(NOT (LISTP (CDR X)))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
0))),
which again simplifies, appealing to the lemma NUMBERP-EVAL$-PLUS-TREE,
and unfolding the functions PLUS, EQUAL, and DIFFERENCE, to two new
conjectures:
Case 4.3.2.2.
(IMPLIES
(AND
(LISTP X)
(MEMBER (CAR X) Y)
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(NOT (LISTP (CDR X)))
(NOT (NUMBERP (EVAL$ T (CAR X) A)))
(NOT (EQUAL (EVAL$ T (PLUS-TREE Y) A) 0)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T (PLUS-TREE Y) A))),
which further simplifies, applying NUMBERP-EVAL$-PLUS-TREE,
PLUS-TREE-DELETE, and SUBBAGP-CDR2, and opening up the functions
BAGDIFF, DIFFERENCE, PLUS-TREE, CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$,
and SUBBAGP, to:
T.
Case 4.3.2.1.
(IMPLIES
(AND
(LISTP X)
(MEMBER (CAR X) Y)
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(NOT (LISTP (CDR X)))
(NOT (NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T (PLUS-TREE Y) A) 0))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
0)).
But this again simplifies, using linear arithmetic, to two new
conjectures:
Case 4.3.2.1.2.
(IMPLIES
(AND
(NOT
(NUMBERP
(EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)))
(LISTP X)
(MEMBER (CAR X) Y)
(EQUAL
(EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE 0
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(NOT (LISTP (CDR X)))
(NOT (NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T (PLUS-TREE Y) A) 0))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
0)),
which again simplifies, clearly, to:
T.
Case 4.3.2.1.1.
(IMPLIES
(AND
(LESSP 0
(EVAL$ T (PLUS-TREE (CDR X)) A))
(LISTP X)
(MEMBER (CAR X) Y)
(EQUAL
(EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE 0
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(NOT (LISTP (CDR X)))
(NOT (NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T (PLUS-TREE Y) A) 0))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
0)).
This again simplifies, using linear arithmetic, applying
SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP and PLUS-TREE-DELETE, and
expanding DIFFERENCE, to:
T.
Case 4.3.1.
(IMPLIES
(AND
(LISTP X)
(MEMBER (CAR X) Y)
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (PLUS-TREE (CDR X)) A))))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(NOT (LISTP (CDR X)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A)))).
However this further simplifies, applying PLUS-TREE-DELETE,
PLUS-ZERO-ARG2, and SUBBAGP-CDR2, and unfolding BAGDIFF, PLUS-TREE, CDR,
CAR, LISTP, LITATOM, EQUAL, EVAL$, ZEROP, and SUBBAGP, to:
T.
Case 4.2.
(IMPLIES
(AND (LISTP X)
(MEMBER (CAR X) Y)
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (PLUS-TREE (CDR X)) A))))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(LISTP (CDDR X)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T
(LIST 'PLUS
(CAR X)
(PLUS-TREE (CDR X)))
A)))).
However this again simplifies, appealing to the lemmas REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, to:
T.
Case 4.1.
(IMPLIES
(AND (LISTP X)
(MEMBER (CAR X) Y)
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (PLUS-TREE (CDR X)) A))))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(NOT (LISTP (CDDR X))))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T
(LIST 'PLUS (CAR X) (CADR X))
A)))),
which again simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, to the new formula:
(IMPLIES
(AND (LISTP X)
(MEMBER (CAR X) Y)
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (PLUS-TREE (CDR X)) A))))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(NOT (LISTP (CDDR X))))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (CADR X) A))))),
which further simplifies, appealing to the lemmas REWRITE-EVAL$, CAR-CONS,
and PLUS-ZERO-ARG2, and opening up the definitions of PLUS-TREE, FIX, and
ZEROP, to two new conjectures:
Case 4.1.2.
(IMPLIES
(AND
(LISTP X)
(MEMBER (CAR X) Y)
(NOT (NUMBERP (EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A) 0)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
0))),
which again simplifies, rewriting with PLUS-ZERO-ARG2 and
NUMBERP-EVAL$-PLUS-TREE, and opening up the definitions of ZEROP, EQUAL,
and DIFFERENCE, to:
T.
Case 4.1.1.
(IMPLIES
(AND
(LISTP X)
(MEMBER (CAR X) Y)
(NOT (NUMBERP (EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A) 0)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A)))).
But this again simplifies, using linear arithmetic, to three new goals:
Case 4.1.1.3.
(IMPLIES
(AND
(LESSP (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A) 0))
(LISTP X)
(MEMBER (CAR X) Y)
(NOT (NUMBERP (EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A) 0)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A)))),
which again simplifies, using linear arithmetic and appealing to the
lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:
T.
Case 4.1.1.2.
(IMPLIES
(AND
(NOT
(NUMBERP
(EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)))
(LISTP X)
(MEMBER (CAR X) Y)
(NOT (NUMBERP (EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A) 0)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A)))),
which again simplifies, obviously, to:
T.
Case 4.1.1.1.
(IMPLIES
(AND
(LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A))
(LISTP X)
(MEMBER (CAR X) Y)
(NOT (NUMBERP (EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A) 0)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A)))).
However this again simplifies, using linear arithmetic, to:
(IMPLIES
(AND
(LESSP (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A) 0))
(LESSP (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A))
(LISTP X)
(MEMBER (CAR X) Y)
(NOT (NUMBERP (EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(PLUS (EVAL$ T (CAR X) A) 0)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A)))).
This finally simplifies, using linear arithmetic and applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:
T.
Case 3. (IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) Y))
(NOT (SUBBAGP (CDR X) Y))
(SUBBAGP X Y))
(EQUAL (EVAL$ T (PLUS-TREE (BAGDIFF Y X)) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE X) A)))).
This simplifies, expanding the function SUBBAGP, to:
T.
Case 2. (IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) Y))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF Y (CDR X)))
A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(SUBBAGP X Y))
(EQUAL (EVAL$ T (PLUS-TREE (BAGDIFF Y X)) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE X) A)))).
This simplifies, expanding the definition of SUBBAGP, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP X)) (SUBBAGP X Y))
(EQUAL (EVAL$ T (PLUS-TREE (BAGDIFF Y X)) A)
(DIFFERENCE (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE X) A)))).
This simplifies, rewriting with SUBBAGP-CDR2 and NUMBERP-EVAL$-PLUS-TREE,
and unfolding the definitions of SUBBAGP, BAGDIFF, PLUS-TREE, CDR, CAR,
LISTP, LITATOM, EQUAL, EVAL$, and DIFFERENCE, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 10.2 0.0 ]
PLUS-TREE-BAGDIFF
(DISABLE PLUS-TREE-BAGDIFF)
[ 0.0 0.0 0.0 ]
PLUS-TREE-BAGDIFF-OFF
(LEMMA NUMBERP-EVAL$-BRIDGE
(REWRITE)
(IMPLIES (EQUAL (EVAL$ T Z A)
(EVAL$ T (PLUS-TREE X) A))
(NUMBERP (EVAL$ T Z A)))
((ENABLE PLUS-TREE NUMBERP-EVAL$-PLUS-TREE)))
WARNING: Note that NUMBERP-EVAL$-BRIDGE contains the free variable X which
will be chosen by instantiating the hypothesis:
(EQUAL (EVAL$ T Z A)
(EVAL$ T (PLUS-TREE X) A)).
.
We use the above equality hypothesis by substituting (EVAL$ T (PLUS-TREE X) A)
for (EVAL$ T Z A) and keeping the equality hypothesis. This produces the new
goal:
(IMPLIES (EQUAL (EVAL$ T Z A)
(EVAL$ T (PLUS-TREE X) A))
(NUMBERP (EVAL$ T (PLUS-TREE X) A))),
which simplifies, trivially, to:
(IMPLIES (EQUAL (EVAL$ T Z A)
(EVAL$ T (PLUS-TREE X) A))
(NUMBERP (EVAL$ T Z A))),
which we would normally push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we have
previously done, give the name *1 to the original input, and work on it.
So now let us return to:
(IMPLIES (EQUAL (EVAL$ T Z A)
(EVAL$ T (PLUS-TREE X) A))
(NUMBERP (EVAL$ T Z A))),
named *1. Let us appeal to the induction principle. Three inductions are
suggested by terms in the conjecture. They merge into two likely candidate
inductions, both of which are unflawed. So we will choose the one suggested
by the largest number of nonprimitive recursive functions. We will induct
according to the following scheme:
(AND (IMPLIES (LITATOM Z) (p Z A X))
(IMPLIES (AND (NOT (LITATOM Z)) (NLISTP Z))
(p Z A X))
(IMPLIES (AND (NOT (LITATOM Z))
(NOT (NLISTP Z))
(EQUAL (CAR Z) 'QUOTE))
(p Z A X))
(IMPLIES (AND (NOT (LITATOM Z))
(NOT (NLISTP Z))
(NOT (EQUAL (CAR Z) 'QUOTE))
(p (CDR Z) A X))
(p Z A X))).
Linear arithmetic, the lemmas CDR-LESSEQP, CDR-LESSP, CAR-LESSEQP, and
CAR-LESSP, and the definition of NLISTP inform us that the measure (COUNT Z)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme produces five new conjectures:
Case 5. (IMPLIES (AND (LITATOM Z)
(EQUAL (EVAL$ T Z A)
(EVAL$ T (PLUS-TREE X) A)))
(NUMBERP (EVAL$ T Z A))),
which simplifies, unfolding the functions EVAL$ and EQUAL, to:
(IMPLIES (AND (LITATOM Z)
(EQUAL (CDR (ASSOC Z A))
(EVAL$ T (PLUS-TREE X) A)))
(NUMBERP (CDR (ASSOC Z A)))).
We use the above equality hypothesis by substituting:
(EVAL$ T (PLUS-TREE X) A)
for (CDR (ASSOC Z A)) and throwing away the equality. We thus obtain:
(IMPLIES (LITATOM Z)
(NUMBERP (EVAL$ T (PLUS-TREE X) A))),
which further simplifies, rewriting with the lemma NUMBERP-EVAL$-PLUS-TREE,
to:
T.
Case 4. (IMPLIES (AND (NOT (LITATOM Z))
(NLISTP Z)
(EQUAL (EVAL$ T Z A)
(EVAL$ T (PLUS-TREE X) A)))
(NUMBERP (EVAL$ T Z A))),
which simplifies, opening up NLISTP, EVAL$, and EQUAL, to:
(IMPLIES (AND (NOT (LITATOM Z))
(NOT (LISTP Z))
(EQUAL Z (EVAL$ T (PLUS-TREE X) A)))
(NUMBERP Z)).
But this again simplifies, applying NUMBERP-EVAL$-PLUS-TREE, to:
T.
Case 3. (IMPLIES (AND (NOT (LITATOM Z))
(NOT (NLISTP Z))
(EQUAL (CAR Z) 'QUOTE)
(EQUAL (EVAL$ T Z A)
(EVAL$ T (PLUS-TREE X) A)))
(NUMBERP (EVAL$ T Z A))).
This simplifies, expanding the functions NLISTP, EVAL$, and EQUAL, to the
new formula:
(IMPLIES (AND (NOT (LITATOM Z))
(LISTP Z)
(EQUAL (CAR Z) 'QUOTE)
(EQUAL (CADR Z)
(EVAL$ T (PLUS-TREE X) A)))
(NUMBERP (CADR Z))),
which again simplifies, obviously, to:
(IMPLIES (AND (LISTP Z)
(EQUAL (CAR Z) 'QUOTE)
(EQUAL (CADR Z)
(EVAL$ T (PLUS-TREE X) A)))
(NUMBERP (CADR Z))).
Applying the lemma CAR-CDR-ELIM, replace Z by (CONS V W) to eliminate
(CAR Z) and (CDR Z) and W by (CONS D C) to eliminate (CAR W) and (CDR W).
This produces the following two new conjectures:
Case 3.2.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL V 'QUOTE)
(EQUAL (CAR W)
(EVAL$ T (PLUS-TREE X) A)))
(NUMBERP (CAR W))).
But this further simplifies, rewriting with CAR-NLISTP, and unfolding the
definition of NUMBERP, to:
T.
Case 3.1.
(IMPLIES (AND (EQUAL V 'QUOTE)
(EQUAL D (EVAL$ T (PLUS-TREE X) A)))
(NUMBERP D)).
However this further simplifies, applying NUMBERP-EVAL$-PLUS-TREE, to:
T.
Case 2. (IMPLIES (AND (NOT (LITATOM Z))
(NOT (NLISTP Z))
(NOT (EQUAL (CAR Z) 'QUOTE))
(NOT (EQUAL (EVAL$ T (CDR Z) A)
(EVAL$ T (PLUS-TREE X) A)))
(EQUAL (EVAL$ T Z A)
(EVAL$ T (PLUS-TREE X) A)))
(NUMBERP (EVAL$ T Z A))).
This simplifies, applying the lemmas SUB1-ADD1, REWRITE-APPLY$,
NUMBERP-EVAL$-PLUS-TREE, and CAR-CONS, and opening up NLISTP, EVAL$, EQUAL,
V&C-APPLY$, PLUS, FIX-COST, APPLY$, CAR, and NUMBERP, to:
T.
Case 1. (IMPLIES (AND (NOT (LITATOM Z))
(NOT (NLISTP Z))
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (EVAL$ T Z A)
(EVAL$ T (PLUS-TREE X) A)))
(NUMBERP (EVAL$ T Z A))).
This simplifies, applying the lemmas SUB1-ADD1, REWRITE-APPLY$, and CAR-CONS,
and expanding the definitions of NLISTP, EVAL$, EQUAL, V&C-APPLY$, PLUS,
FIX-COST, APPLY$, CAR, and NUMBERP, to the following 16 new goals:
Case 1.16.
(IMPLIES (AND (NOT (LITATOM Z))
(LISTP Z)
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(NOT (CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL (CAR F)
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST (CDR Z) A))))
(NUMBERP (CADDR (EVAL$ 'LIST (CDR Z) A)))).
This again simplifies, expanding the definitions of EQUAL and CAR, to:
(IMPLIES (AND (LISTP Z)
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(NOT (CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST (CDR Z) A))))
(NUMBERP (CADDR (EVAL$ 'LIST (CDR Z) A)))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Z by (CONS W V) to
eliminate (CDR Z) and (CAR Z). The result is:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(EQUAL W 'IF)
(NOT (CAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST V A))))
(NUMBERP (CADDR (EVAL$ 'LIST V A)))).
This further simplifies, obviously, to:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(NOT (CAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST V A))))
(NUMBERP (CADDR (EVAL$ 'LIST V A)))),
which we generalize by replacing (EVAL$ (QUOTE LIST) V A) by Y. The
result is:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(NOT (CAR (PAIRLIST Y 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT (CAR Y)))
(NUMBERP (CADDR Y))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Y by (CONS W D) to
eliminate (CAR Y) and (CDR Y), D by (CONS X1 C) to eliminate (CDR D) and
(CAR D), and C by (CONS D Z1) to eliminate (CAR C) and (CDR C). This
generates four new goals:
Case 1.16.4.
(IMPLIES (AND (NOT (LISTP Y))
(NUMBERP (EVAL$ T V A))
(NOT (CAR (PAIRLIST Y 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT (CAR Y)))
(NUMBERP (CADDR Y))),
which finally simplifies, unfolding PAIRLIST and CAR, to:
T.
Case 1.16.3.
(IMPLIES (AND (NOT (LISTP D))
(NUMBERP (EVAL$ T V A))
(NOT (CAR (PAIRLIST (CONS W D) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP (CADR D))),
which finally simplifies, applying the lemmas CDR-CONS and CAR-CONS, and
unfolding CDR, CONS, CAR, and PAIRLIST, to:
T.
Case 1.16.2.
(IMPLIES (AND (NOT (LISTP C))
(NUMBERP (EVAL$ T V A))
(NOT (CAR (PAIRLIST (CONS W (CONS X1 C)) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP (CAR C))),
which finally simplifies, appealing to the lemmas CDR-CONS and CAR-CONS,
and unfolding CDR, CONS, CAR, and PAIRLIST, to:
T.
Case 1.16.1.
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(NOT (CAR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP D)),
which finally simplifies, applying CDR-CONS and CAR-CONS, and opening up
the definitions of CDR, CONS, CAR, and PAIRLIST, to:
T.
Case 1.15.
(IMPLIES (AND (NOT (LITATOM Z))
(LISTP Z)
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(NOT (CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL (CAR F)
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST (CDR Z) A)))
(NUMBERP (CADR (EVAL$ 'LIST (CDR Z) A)))).
However this again simplifies, unfolding EQUAL and CAR, to the goal:
(IMPLIES (AND (LISTP Z)
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(NOT (CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST (CDR Z) A)))
(NUMBERP (CADR (EVAL$ 'LIST (CDR Z) A)))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Z by (CONS W V) to
eliminate (CDR Z) and (CAR Z). The result is:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(EQUAL W 'IF)
(NOT (CAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST V A)))
(NUMBERP (CADR (EVAL$ 'LIST V A)))).
This further simplifies, clearly, to the new formula:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(NOT (CAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST V A)))
(NUMBERP (CADR (EVAL$ 'LIST V A)))),
which we generalize by replacing (EVAL$ (QUOTE LIST) V A) by Y. We must
thus prove the formula:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(NOT (CAR (PAIRLIST Y 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(CAR Y))
(NUMBERP (CADR Y))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Y by (CONS W D) to
eliminate (CAR Y) and (CDR Y) and D by (CONS C X1) to eliminate (CAR D)
and (CDR D). This generates three new conjectures:
Case 1.15.3.
(IMPLIES (AND (NOT (LISTP Y))
(NUMBERP (EVAL$ T V A))
(NOT (CAR (PAIRLIST Y 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(CAR Y))
(NUMBERP (CADR Y))),
which finally simplifies, expanding the functions PAIRLIST and CAR, to:
T.
Case 1.15.2.
(IMPLIES (AND (NOT (LISTP D))
(NUMBERP (EVAL$ T V A))
(NOT (CAR (PAIRLIST (CONS W D) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
W)
(NUMBERP (CAR D))),
which finally simplifies, rewriting with CDR-CONS and CAR-CONS, and
opening up the definitions of CDR, CAR, and PAIRLIST, to:
T.
Case 1.15.1.
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(NOT (CAR (PAIRLIST (CONS W (CONS C X1)) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
W)
(NUMBERP C)).
But this finally simplifies, applying the lemmas CDR-CONS and CAR-CONS,
and unfolding the definitions of CDR, CAR, and PAIRLIST, to:
T.
Case 1.14.
(IMPLIES (AND (NOT (LITATOM Z))
(LISTP Z)
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (CADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL (CAR F)
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST (CDR Z) A))))
(NUMBERP (CADDR (EVAL$ 'LIST (CDR Z) A)))),
which again simplifies, unfolding the functions EQUAL and CAR, to:
(IMPLIES (AND (LISTP Z)
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (CADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST (CDR Z) A))))
(NUMBERP (CADDR (EVAL$ 'LIST (CDR Z) A)))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Z by (CONS W V) to
eliminate (CDR Z) and (CAR Z). We must thus prove the conjecture:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(EQUAL W 'IF)
(CAAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (CADR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST V A))))
(NUMBERP (CADDR (EVAL$ 'LIST V A)))).
This further simplifies, obviously, to:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (CADR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST V A))))
(NUMBERP (CADDR (EVAL$ 'LIST V A)))),
which we generalize by replacing (EVAL$ (QUOTE LIST) V A) by Y. The
result is:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAAR (PAIRLIST Y 0))
(NOT (CADR (PAIRLIST Y 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT (CAR Y)))
(NUMBERP (CADDR Y))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Y by (CONS W D) to
eliminate (CAR Y) and (CDR Y), D by (CONS X1 C) to eliminate (CDR D) and
(CAR D), and C by (CONS D Z1) to eliminate (CAR C) and (CDR C). This
generates four new conjectures:
Case 1.14.4.
(IMPLIES (AND (NOT (LISTP Y))
(NUMBERP (EVAL$ T V A))
(CAAR (PAIRLIST Y 0))
(NOT (CADR (PAIRLIST Y 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT (CAR Y)))
(NUMBERP (CADDR Y))),
which finally simplifies, expanding the functions PAIRLIST, CAR, and CDR,
to:
T.
Case 1.14.3.
(IMPLIES (AND (NOT (LISTP D))
(NUMBERP (EVAL$ T V A))
(CAAR (PAIRLIST (CONS W D) 0))
(NOT (CADR (PAIRLIST (CONS W D) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP (CADR D))),
which finally simplifies, appealing to the lemmas CDR-CONS and CAR-CONS,
and expanding CDR, CONS, CAR, and PAIRLIST, to:
T.
Case 1.14.2.
(IMPLIES (AND (NOT (LISTP C))
(NUMBERP (EVAL$ T V A))
(CAAR (PAIRLIST (CONS W (CONS X1 C)) 0))
(NOT (CADR (PAIRLIST (CONS W (CONS X1 C)) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP (CAR C))),
which finally simplifies, applying CDR-CONS and CAR-CONS, and opening up
the functions CDR, CONS, CAR, and PAIRLIST, to:
T.
Case 1.14.1.
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAAR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))
(NOT (CADR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP D)).
However this finally simplifies, applying the lemmas CDR-CONS and
CAR-CONS, and unfolding the definitions of CDR, CONS, CAR, and PAIRLIST,
to:
T.
Case 1.13.
(IMPLIES (AND (NOT (LITATOM Z))
(LISTP Z)
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (CADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL (CAR F)
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST (CDR Z) A)))
(NUMBERP (CADR (EVAL$ 'LIST (CDR Z) A)))),
which again simplifies, unfolding the definitions of EQUAL and CAR, to:
(IMPLIES (AND (LISTP Z)
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (CADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST (CDR Z) A)))
(NUMBERP (CADR (EVAL$ 'LIST (CDR Z) A)))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Z by (CONS W V) to
eliminate (CDR Z) and (CAR Z). We must thus prove:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(EQUAL W 'IF)
(CAAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (CADR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST V A)))
(NUMBERP (CADR (EVAL$ 'LIST V A)))).
This further simplifies, clearly, to the new conjecture:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (CADR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST V A)))
(NUMBERP (CADR (EVAL$ 'LIST V A)))),
which we generalize by replacing (EVAL$ (QUOTE LIST) V A) by Y. We must
thus prove the formula:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAAR (PAIRLIST Y 0))
(NOT (CADR (PAIRLIST Y 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(CAR Y))
(NUMBERP (CADR Y))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Y by (CONS W D) to
eliminate (CAR Y) and (CDR Y) and D by (CONS C X1) to eliminate (CAR D)
and (CDR D). The result is three new conjectures:
Case 1.13.3.
(IMPLIES (AND (NOT (LISTP Y))
(NUMBERP (EVAL$ T V A))
(CAAR (PAIRLIST Y 0))
(NOT (CADR (PAIRLIST Y 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(CAR Y))
(NUMBERP (CADR Y))),
which finally simplifies, unfolding the functions PAIRLIST, CAR, and CDR,
to:
T.
Case 1.13.2.
(IMPLIES (AND (NOT (LISTP D))
(NUMBERP (EVAL$ T V A))
(CAAR (PAIRLIST (CONS W D) 0))
(NOT (CADR (PAIRLIST (CONS W D) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
W)
(NUMBERP (CAR D))),
which finally simplifies, applying CDR-CONS and CAR-CONS, and opening up
CDR, CAR, and PAIRLIST, to:
T.
Case 1.13.1.
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAAR (PAIRLIST (CONS W (CONS C X1)) 0))
(NOT (CADR (PAIRLIST (CONS W (CONS C X1)) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
W)
(NUMBERP C)).
But this finally simplifies, rewriting with CDR-CONS and CAR-CONS, and
unfolding CDR, CAR, and PAIRLIST, to:
T.
Case 1.12.
(IMPLIES (AND (NOT (LITATOM Z))
(LISTP Z)
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(NOT (CADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL (CAR F)
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST (CDR Z) A))))
(NUMBERP (CADDR (EVAL$ 'LIST (CDR Z) A)))).
This again simplifies, unfolding the functions EQUAL and CAR, to:
(IMPLIES (AND (LISTP Z)
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(NOT (CADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST (CDR Z) A))))
(NUMBERP (CADDR (EVAL$ 'LIST (CDR Z) A)))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Z by (CONS W V) to
eliminate (CDR Z) and (CAR Z). The result is:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(EQUAL W 'IF)
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(NOT (CADDR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST V A))))
(NUMBERP (CADDR (EVAL$ 'LIST V A)))).
This further simplifies, obviously, to:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(NOT (CADDR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST V A))))
(NUMBERP (CADDR (EVAL$ 'LIST V A)))),
which we generalize by replacing (EVAL$ (QUOTE LIST) V A) by Y. The
result is:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(NOT (CAAR (PAIRLIST Y 0)))
(NOT (CADDR (PAIRLIST Y 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT (CAR Y)))
(NUMBERP (CADDR Y))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Y by (CONS W D) to
eliminate (CAR Y) and (CDR Y), D by (CONS X1 C) to eliminate (CDR D) and
(CAR D), and C by (CONS D Z1) to eliminate (CAR C) and (CDR C). The
result is four new conjectures:
Case 1.12.4.
(IMPLIES (AND (NOT (LISTP Y))
(NUMBERP (EVAL$ T V A))
(NOT (CAAR (PAIRLIST Y 0)))
(NOT (CADDR (PAIRLIST Y 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT (CAR Y)))
(NUMBERP (CADDR Y))),
which finally simplifies, opening up PAIRLIST and CAR, to:
T.
Case 1.12.3.
(IMPLIES (AND (NOT (LISTP D))
(NUMBERP (EVAL$ T V A))
(NOT (CAAR (PAIRLIST (CONS W D) 0)))
(NOT (CADDR (PAIRLIST (CONS W D) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP (CADR D))),
which finally simplifies, applying the lemmas CDR-CONS and CAR-CONS, and
opening up CDR, CONS, CAR, and PAIRLIST, to:
T.
Case 1.12.2.
(IMPLIES (AND (NOT (LISTP C))
(NUMBERP (EVAL$ T V A))
(NOT (CAAR (PAIRLIST (CONS W (CONS X1 C)) 0)))
(NOT (CADDR (PAIRLIST (CONS W (CONS X1 C)) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP (CAR C))),
which finally simplifies, rewriting with CDR-CONS and CAR-CONS, and
opening up CDR, CONS, CAR, and PAIRLIST, to:
T.
Case 1.12.1.
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(NOT (CAAR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0)))
(NOT (CADDR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP D)).
However this finally simplifies, applying CDR-CONS and CAR-CONS, and
unfolding the definitions of CDR, CONS, CAR, and PAIRLIST, to:
T.
Case 1.11.
(IMPLIES (AND (NOT (LITATOM Z))
(LISTP Z)
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(NOT (CADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL (CAR F)
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST (CDR Z) A)))
(NUMBERP (CADR (EVAL$ 'LIST (CDR Z) A)))).
This again simplifies, unfolding the functions EQUAL and CAR, to:
(IMPLIES (AND (LISTP Z)
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(NOT (CADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST (CDR Z) A)))
(NUMBERP (CADR (EVAL$ 'LIST (CDR Z) A)))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Z by (CONS W V) to
eliminate (CDR Z) and (CAR Z). This generates:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(EQUAL W 'IF)
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(NOT (CADDR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST V A)))
(NUMBERP (CADR (EVAL$ 'LIST V A)))).
This further simplifies, trivially, to the new formula:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(NOT (CADDR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST V A)))
(NUMBERP (CADR (EVAL$ 'LIST V A)))),
which we generalize by replacing (EVAL$ (QUOTE LIST) V A) by Y. This
generates the goal:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(NOT (CAAR (PAIRLIST Y 0)))
(NOT (CADDR (PAIRLIST Y 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(CAR Y))
(NUMBERP (CADR Y))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Y by (CONS W D) to
eliminate (CAR Y) and (CDR Y) and D by (CONS C X1) to eliminate (CAR D)
and (CDR D). This generates three new formulas:
Case 1.11.3.
(IMPLIES (AND (NOT (LISTP Y))
(NUMBERP (EVAL$ T V A))
(NOT (CAAR (PAIRLIST Y 0)))
(NOT (CADDR (PAIRLIST Y 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
(CAR Y))
(NUMBERP (CADR Y))),
which finally simplifies, opening up the definitions of PAIRLIST and CAR,
to:
T.
Case 1.11.2.
(IMPLIES (AND (NOT (LISTP D))
(NUMBERP (EVAL$ T V A))
(NOT (CAAR (PAIRLIST (CONS W D) 0)))
(NOT (CADDR (PAIRLIST (CONS W D) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
W)
(NUMBERP (CAR D))),
which finally simplifies, applying the lemmas CDR-CONS and CAR-CONS, and
expanding the functions CDR, CAR, and PAIRLIST, to:
T.
Case 1.11.1.
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(NOT (CAAR (PAIRLIST (CONS W (CONS C X1)) 0)))
(NOT (CADDR (PAIRLIST (CONS W (CONS C X1)) 0)))
(EQUAL 0 (EVAL$ T (PLUS-TREE X) A))
W)
(NUMBERP C)),
which finally simplifies, rewriting with CDR-CONS and CAR-CONS, and
unfolding the definitions of CDR, CAR, and PAIRLIST, to:
T.
Case 1.10.
(IMPLIES
(AND
(NOT (LITATOM Z))
(LISTP Z)
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(NOT (EQUAL (CAR Z) 'IF))
(NOT (MEMBER F
(PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(NOT (SUBRP (CAR Z)))
(V&C$ T
(BODY (CAR Z))
(PAIRLIST (FORMALS (CAR Z))
(STRIP-CARS (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))
(EQUAL
(CAR
(CONS
(CAR
(V&C$ T
(BODY (CAR Z))
(PAIRLIST (FORMALS (CAR Z))
(STRIP-CARS (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))))
(ADD1
(PLUS
(SUM-CDRS (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CDR
(V&C$ T
(BODY (CAR Z))
(PAIRLIST (FORMALS (CAR Z))
(STRIP-CARS (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))))))))
(EVAL$ T (PLUS-TREE X) A)))
(NUMBERP
(CAR (V&C$ T
(BODY (CAR Z))
(PAIRLIST (FORMALS (CAR Z))
(STRIP-CARS (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))))).
However this again simplifies, applying the lemmas CAR-CONS and
NUMBERP-EVAL$-PLUS-TREE, to:
T.
Case 1.9.
(IMPLIES
(AND
(NOT (LITATOM Z))
(LISTP Z)
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(NOT (EQUAL (CAR Z) 'IF))
(NOT (MEMBER F
(PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(SUBRP (CAR Z))
(EQUAL
(CAR
(CONS (APPLY-SUBR (CAR Z)
(STRIP-CARS (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(ADD1 (SUM-CDRS (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))))
(EVAL$ T (PLUS-TREE X) A)))
(NUMBERP (APPLY-SUBR (CAR Z)
(STRIP-CARS (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))),
which again simplifies, applying CAR-CONS and NUMBERP-EVAL$-PLUS-TREE, to:
T.
Case 1.8.
(IMPLIES
(AND
(NOT (LITATOM Z))
(LISTP Z)
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(CADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))
(EQUAL
(CAR (CONS (CAADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(ADD1 (PLUS 0
(CDADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST (CDR Z) A))))
(NUMBERP (CADDR (EVAL$ 'LIST (CDR Z) A)))).
But this again simplifies, applying CAR-CONS, and opening up the functions
EQUAL and PLUS, to the new formula:
(IMPLIES (AND (LISTP Z)
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(CADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))
(EQUAL (CAADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST (CDR Z) A))))
(NUMBERP (CADDR (EVAL$ 'LIST (CDR Z) A)))).
Applying the lemma CAR-CDR-ELIM, replace Z by (CONS W V) to eliminate
(CDR Z) and (CAR Z). We would thus like to prove:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(EQUAL W 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(CADDR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST V A) 0))))
(EQUAL (CAADDR (PAIRLIST (EVAL$ 'LIST V A) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST V A))))
(NUMBERP (CADDR (EVAL$ 'LIST V A)))),
which further simplifies, obviously, to:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(CADDR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST V A) 0))))
(EQUAL (CAADDR (PAIRLIST (EVAL$ 'LIST V A) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST V A))))
(NUMBERP (CADDR (EVAL$ 'LIST V A)))),
which we generalize by replacing (EVAL$ (QUOTE LIST) V A) by Y. This
generates the conjecture:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST Y 0))
(NOT (CAAR (PAIRLIST Y 0)))
(CADDR (PAIRLIST Y 0))
(NOT (NUMBERP (CDAR (PAIRLIST Y 0))))
(EQUAL (CAADDR (PAIRLIST Y 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR Y)))
(NUMBERP (CADDR Y))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Y by (CONS W D) to
eliminate (CAR Y) and (CDR Y), D by (CONS X1 C) to eliminate (CDR D) and
(CAR D), and C by (CONS D Z1) to eliminate (CAR C) and (CDR C). This
generates four new conjectures:
Case 1.8.4.
(IMPLIES (AND (NOT (LISTP Y))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST Y 0))
(NOT (CAAR (PAIRLIST Y 0)))
(CADDR (PAIRLIST Y 0))
(NOT (NUMBERP (CDAR (PAIRLIST Y 0))))
(EQUAL (CAADDR (PAIRLIST Y 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR Y)))
(NUMBERP (CADDR Y))),
which finally simplifies, unfolding the definitions of PAIRLIST and CAR,
to:
T.
Case 1.8.3.
(IMPLIES (AND (NOT (LISTP D))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W D) 0))
(NOT (CAAR (PAIRLIST (CONS W D) 0)))
(CADDR (PAIRLIST (CONS W D) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (CONS W D) 0))))
(EQUAL (CAADDR (PAIRLIST (CONS W D) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP (CADR D))),
which finally simplifies, rewriting with the lemmas CDR-CONS and
CAR-CONS, and unfolding the definitions of CDR, CONS, CAR, PAIRLIST, and
NUMBERP, to:
T.
Case 1.8.2.
(IMPLIES
(AND (NOT (LISTP C))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W (CONS X1 C)) 0))
(NOT (CAAR (PAIRLIST (CONS W (CONS X1 C)) 0)))
(CADDR (PAIRLIST (CONS W (CONS X1 C)) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (CONS W (CONS X1 C)) 0))))
(EQUAL (CAADDR (PAIRLIST (CONS W (CONS X1 C)) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP (CAR C))),
which finally simplifies, applying CDR-CONS and CAR-CONS, and unfolding
CDR, CONS, CAR, PAIRLIST, and NUMBERP, to:
T.
Case 1.8.1.
(IMPLIES
(AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))
(NOT (CAAR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0)))
(CADDR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))
(NOT (NUMBERP (CDAR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))))
(EQUAL (CAADDR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))
(EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP D)).
But this finally simplifies, rewriting with CDR-CONS and CAR-CONS, and
opening up CDR, CONS, CAR, PAIRLIST, and NUMBERP, to:
T.
Case 1.7.
(IMPLIES
(AND
(NOT (LITATOM Z))
(LISTP Z)
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(CADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))
(EQUAL
(CAR (CONS (CAADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(ADD1 (PLUS 0
(CDADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))))
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST (CDR Z) A)))
(NUMBERP (CADR (EVAL$ 'LIST (CDR Z) A)))).
This again simplifies, rewriting with the lemma CAR-CONS, and opening up
EQUAL and PLUS, to:
(IMPLIES (AND (LISTP Z)
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(CADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))
(EQUAL (CAADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST (CDR Z) A)))
(NUMBERP (CADR (EVAL$ 'LIST (CDR Z) A)))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Z by (CONS W V) to
eliminate (CDR Z) and (CAR Z). We must thus prove:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(EQUAL W 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(CADDR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST V A) 0))))
(EQUAL (CAADDR (PAIRLIST (EVAL$ 'LIST V A) 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST V A)))
(NUMBERP (CADR (EVAL$ 'LIST V A)))).
This further simplifies, obviously, to:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(CADDR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST V A) 0))))
(EQUAL (CAADDR (PAIRLIST (EVAL$ 'LIST V A) 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST V A)))
(NUMBERP (CADR (EVAL$ 'LIST V A)))),
which we generalize by replacing (EVAL$ (QUOTE LIST) V A) by Y. This
generates:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST Y 0))
(NOT (CAAR (PAIRLIST Y 0)))
(CADDR (PAIRLIST Y 0))
(NOT (NUMBERP (CDAR (PAIRLIST Y 0))))
(EQUAL (CAADDR (PAIRLIST Y 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR Y))
(NUMBERP (CADR Y))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Y by (CONS W D) to
eliminate (CAR Y) and (CDR Y) and D by (CONS C X1) to eliminate (CAR D)
and (CDR D). This generates three new goals:
Case 1.7.3.
(IMPLIES (AND (NOT (LISTP Y))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST Y 0))
(NOT (CAAR (PAIRLIST Y 0)))
(CADDR (PAIRLIST Y 0))
(NOT (NUMBERP (CDAR (PAIRLIST Y 0))))
(EQUAL (CAADDR (PAIRLIST Y 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR Y))
(NUMBERP (CADR Y))),
which finally simplifies, unfolding PAIRLIST and CAR, to:
T.
Case 1.7.2.
(IMPLIES (AND (NOT (LISTP D))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W D) 0))
(NOT (CAAR (PAIRLIST (CONS W D) 0)))
(CADDR (PAIRLIST (CONS W D) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (CONS W D) 0))))
(EQUAL (CAADDR (PAIRLIST (CONS W D) 0))
(EVAL$ T (PLUS-TREE X) A))
W)
(NUMBERP (CAR D))),
which finally simplifies, applying CDR-CONS and CAR-CONS, and expanding
the functions CDR, CAR, and PAIRLIST, to:
T.
Case 1.7.1.
(IMPLIES
(AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W (CONS C X1)) 0))
(NOT (CAAR (PAIRLIST (CONS W (CONS C X1)) 0)))
(CADDR (PAIRLIST (CONS W (CONS C X1)) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (CONS W (CONS C X1)) 0))))
(EQUAL (CAADDR (PAIRLIST (CONS W (CONS C X1)) 0))
(EVAL$ T (PLUS-TREE X) A))
W)
(NUMBERP C)).
However this finally simplifies, rewriting with CDR-CONS and CAR-CONS,
and opening up the definitions of CDR, CAR, and PAIRLIST, to:
T.
Case 1.6.
(IMPLIES
(AND
(NOT (LITATOM Z))
(LISTP Z)
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(CADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL
(CAR
(CONS (CAADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(ADD1 (PLUS (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CDADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST (CDR Z) A))))
(NUMBERP (CADDR (EVAL$ 'LIST (CDR Z) A)))).
But this again simplifies, applying CAR-CONS, and unfolding EQUAL, to:
(IMPLIES (AND (LISTP Z)
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(CADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL (CAADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST (CDR Z) A))))
(NUMBERP (CADDR (EVAL$ 'LIST (CDR Z) A)))).
Applying the lemma CAR-CDR-ELIM, replace Z by (CONS W V) to eliminate
(CDR Z) and (CAR Z). We thus obtain:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(EQUAL W 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(CADDR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL (CAADDR (PAIRLIST (EVAL$ 'LIST V A) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST V A))))
(NUMBERP (CADDR (EVAL$ 'LIST V A)))),
which further simplifies, clearly, to the new goal:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(CADDR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL (CAADDR (PAIRLIST (EVAL$ 'LIST V A) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST V A))))
(NUMBERP (CADDR (EVAL$ 'LIST V A)))),
which we generalize by replacing (EVAL$ (QUOTE LIST) V A) by Y. This
generates:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST Y 0))
(NOT (CAAR (PAIRLIST Y 0)))
(CADDR (PAIRLIST Y 0))
(NUMBERP (CDAR (PAIRLIST Y 0)))
(EQUAL (CAADDR (PAIRLIST Y 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR Y)))
(NUMBERP (CADDR Y))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Y by (CONS W D) to
eliminate (CAR Y) and (CDR Y), D by (CONS X1 C) to eliminate (CDR D) and
(CAR D), and C by (CONS D Z1) to eliminate (CAR C) and (CDR C). The
result is four new formulas:
Case 1.6.4.
(IMPLIES (AND (NOT (LISTP Y))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST Y 0))
(NOT (CAAR (PAIRLIST Y 0)))
(CADDR (PAIRLIST Y 0))
(NUMBERP (CDAR (PAIRLIST Y 0)))
(EQUAL (CAADDR (PAIRLIST Y 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR Y)))
(NUMBERP (CADDR Y))),
which finally simplifies, unfolding the definitions of PAIRLIST and CAR,
to:
T.
Case 1.6.3.
(IMPLIES (AND (NOT (LISTP D))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W D) 0))
(NOT (CAAR (PAIRLIST (CONS W D) 0)))
(CADDR (PAIRLIST (CONS W D) 0))
(NUMBERP (CDAR (PAIRLIST (CONS W D) 0)))
(EQUAL (CAADDR (PAIRLIST (CONS W D) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP (CADR D))),
which finally simplifies, applying CDR-CONS, CAR-CONS, and CDR-NLISTP,
and unfolding CDR, CONS, CAR, PAIRLIST, and NUMBERP, to:
T.
Case 1.6.2.
(IMPLIES (AND (NOT (LISTP C))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W (CONS X1 C)) 0))
(NOT (CAAR (PAIRLIST (CONS W (CONS X1 C)) 0)))
(CADDR (PAIRLIST (CONS W (CONS X1 C)) 0))
(NUMBERP (CDAR (PAIRLIST (CONS W (CONS X1 C)) 0)))
(EQUAL (CAADDR (PAIRLIST (CONS W (CONS X1 C)) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP (CAR C))).
This finally simplifies, rewriting with CDR-CONS, CAR-CONS, and
CAR-NLISTP, and expanding the definitions of CDR, CONS, CAR, PAIRLIST,
and NUMBERP, to:
T.
Case 1.6.1.
(IMPLIES
(AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))
(NOT (CAAR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0)))
(CADDR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))
(NUMBERP (CDAR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0)))
(EQUAL (CAADDR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))
(EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP D)).
But this further simplifies, appealing to the lemmas CDR-CONS and
CAR-CONS, and unfolding the definitions of CDR, CONS, CAR, PAIRLIST, and
NUMBERP, to:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(EQUAL D (EVAL$ T (PLUS-TREE X) A)))
(NUMBERP D)).
This finally simplifies, appealing to the lemma NUMBERP-EVAL$-PLUS-TREE,
to:
T.
Case 1.5.
(IMPLIES
(AND
(NOT (LITATOM Z))
(LISTP Z)
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(CADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL
(CAR
(CONS (CAADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(ADD1 (PLUS (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CDADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))))
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST (CDR Z) A)))
(NUMBERP (CADR (EVAL$ 'LIST (CDR Z) A)))),
which again simplifies, rewriting with CAR-CONS, and opening up the
function EQUAL, to:
(IMPLIES (AND (LISTP Z)
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(CADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL (CAADDR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST (CDR Z) A)))
(NUMBERP (CADR (EVAL$ 'LIST (CDR Z) A)))).
Applying the lemma CAR-CDR-ELIM, replace Z by (CONS W V) to eliminate
(CDR Z) and (CAR Z). We thus obtain the new conjecture:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(EQUAL W 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(CADDR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL (CAADDR (PAIRLIST (EVAL$ 'LIST V A) 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST V A)))
(NUMBERP (CADR (EVAL$ 'LIST V A)))),
which further simplifies, obviously, to:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (CAAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(CADDR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL (CAADDR (PAIRLIST (EVAL$ 'LIST V A) 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST V A)))
(NUMBERP (CADR (EVAL$ 'LIST V A)))),
which we generalize by replacing (EVAL$ (QUOTE LIST) V A) by Y. The
result is:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST Y 0))
(NOT (CAAR (PAIRLIST Y 0)))
(CADDR (PAIRLIST Y 0))
(NUMBERP (CDAR (PAIRLIST Y 0)))
(EQUAL (CAADDR (PAIRLIST Y 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR Y))
(NUMBERP (CADR Y))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Y by (CONS W D) to
eliminate (CAR Y) and (CDR Y) and D by (CONS C X1) to eliminate (CAR D)
and (CDR D). The result is three new conjectures:
Case 1.5.3.
(IMPLIES (AND (NOT (LISTP Y))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST Y 0))
(NOT (CAAR (PAIRLIST Y 0)))
(CADDR (PAIRLIST Y 0))
(NUMBERP (CDAR (PAIRLIST Y 0)))
(EQUAL (CAADDR (PAIRLIST Y 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR Y))
(NUMBERP (CADR Y))),
which finally simplifies, opening up the functions PAIRLIST and CAR, to:
T.
Case 1.5.2.
(IMPLIES (AND (NOT (LISTP D))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W D) 0))
(NOT (CAAR (PAIRLIST (CONS W D) 0)))
(CADDR (PAIRLIST (CONS W D) 0))
(NUMBERP (CDAR (PAIRLIST (CONS W D) 0)))
(EQUAL (CAADDR (PAIRLIST (CONS W D) 0))
(EVAL$ T (PLUS-TREE X) A))
W)
(NUMBERP (CAR D))),
which finally simplifies, applying CDR-CONS and CAR-CONS, and unfolding
the definitions of CDR, CAR, and PAIRLIST, to:
T.
Case 1.5.1.
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W (CONS C X1)) 0))
(NOT (CAAR (PAIRLIST (CONS W (CONS C X1)) 0)))
(CADDR (PAIRLIST (CONS W (CONS C X1)) 0))
(NUMBERP (CDAR (PAIRLIST (CONS W (CONS C X1)) 0)))
(EQUAL (CAADDR (PAIRLIST (CONS W (CONS C X1)) 0))
(EVAL$ T (PLUS-TREE X) A))
W)
(NUMBERP C)).
This finally simplifies, rewriting with CDR-CONS and CAR-CONS, and
expanding the definitions of CDR, CAR, and PAIRLIST, to:
T.
Case 1.4.
(IMPLIES
(AND
(NOT (LITATOM Z))
(LISTP Z)
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))
(EQUAL
(CAR (CONS (CAADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(ADD1 (PLUS 0
(CDADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST (CDR Z) A))))
(NUMBERP (CADDR (EVAL$ 'LIST (CDR Z) A)))).
However this again simplifies, applying CAR-CONS, and opening up the
definitions of EQUAL and PLUS, to the new conjecture:
(IMPLIES (AND (LISTP Z)
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))
(EQUAL (CAADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST (CDR Z) A))))
(NUMBERP (CADDR (EVAL$ 'LIST (CDR Z) A)))).
Applying the lemma CAR-CDR-ELIM, replace Z by (CONS W V) to eliminate
(CDR Z) and (CAR Z). This produces the new formula:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(EQUAL W 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(CAAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(CADR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST V A) 0))))
(EQUAL (CAADR (PAIRLIST (EVAL$ 'LIST V A) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST V A))))
(NUMBERP (CADDR (EVAL$ 'LIST V A)))),
which further simplifies, trivially, to:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(CAAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(CADR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST V A) 0))))
(EQUAL (CAADR (PAIRLIST (EVAL$ 'LIST V A) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST V A))))
(NUMBERP (CADDR (EVAL$ 'LIST V A)))),
which we generalize by replacing (EVAL$ (QUOTE LIST) V A) by Y. This
generates the goal:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST Y 0))
(CAAR (PAIRLIST Y 0))
(CADR (PAIRLIST Y 0))
(NOT (NUMBERP (CDAR (PAIRLIST Y 0))))
(EQUAL (CAADR (PAIRLIST Y 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR Y)))
(NUMBERP (CADDR Y))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Y by (CONS W D) to
eliminate (CAR Y) and (CDR Y), D by (CONS X1 C) to eliminate (CDR D) and
(CAR D), and C by (CONS D Z1) to eliminate (CAR C) and (CDR C). The
result is four new formulas:
Case 1.4.4.
(IMPLIES (AND (NOT (LISTP Y))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST Y 0))
(CAAR (PAIRLIST Y 0))
(CADR (PAIRLIST Y 0))
(NOT (NUMBERP (CDAR (PAIRLIST Y 0))))
(EQUAL (CAADR (PAIRLIST Y 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR Y)))
(NUMBERP (CADDR Y))),
which finally simplifies, opening up the definitions of PAIRLIST, CAR,
CDR, and NUMBERP, to:
T.
Case 1.4.3.
(IMPLIES (AND (NOT (LISTP D))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W D) 0))
(CAAR (PAIRLIST (CONS W D) 0))
(CADR (PAIRLIST (CONS W D) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (CONS W D) 0))))
(EQUAL (CAADR (PAIRLIST (CONS W D) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP (CADR D))),
which finally simplifies, applying CDR-CONS and CAR-CONS, and unfolding
the functions CDR, CONS, CAR, and PAIRLIST, to:
T.
Case 1.4.2.
(IMPLIES
(AND (NOT (LISTP C))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W (CONS X1 C)) 0))
(CAAR (PAIRLIST (CONS W (CONS X1 C)) 0))
(CADR (PAIRLIST (CONS W (CONS X1 C)) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (CONS W (CONS X1 C)) 0))))
(EQUAL (CAADR (PAIRLIST (CONS W (CONS X1 C)) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP (CAR C))).
However this finally simplifies, applying CDR-CONS and CAR-CONS, and
unfolding the functions CDR, CONS, CAR, and PAIRLIST, to:
T.
Case 1.4.1.
(IMPLIES
(AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))
(CAAR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))
(CADR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))
(NOT (NUMBERP (CDAR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))))
(EQUAL (CAADR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))
(EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP D)).
This finally simplifies, applying the lemmas CDR-CONS and CAR-CONS, and
opening up the definitions of CDR, CONS, CAR, and PAIRLIST, to:
T.
Case 1.3.
(IMPLIES
(AND
(NOT (LITATOM Z))
(LISTP Z)
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))
(EQUAL
(CAR (CONS (CAADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(ADD1 (PLUS 0
(CDADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))))
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST (CDR Z) A)))
(NUMBERP (CADR (EVAL$ 'LIST (CDR Z) A)))),
which again simplifies, applying CAR-CONS, and unfolding EQUAL and PLUS,
to the new conjecture:
(IMPLIES (AND (LISTP Z)
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))
(EQUAL (CAADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST (CDR Z) A)))
(NUMBERP (CADR (EVAL$ 'LIST (CDR Z) A)))).
Applying the lemma CAR-CDR-ELIM, replace Z by (CONS W V) to eliminate
(CDR Z) and (CAR Z). This produces the new conjecture:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(EQUAL W 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(CAAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(CADR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST V A) 0))))
(EQUAL (CAADR (PAIRLIST (EVAL$ 'LIST V A) 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST V A)))
(NUMBERP (CADR (EVAL$ 'LIST V A)))),
which further simplifies, clearly, to the new conjecture:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(CAAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(CADR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST V A) 0))))
(EQUAL (CAADR (PAIRLIST (EVAL$ 'LIST V A) 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST V A)))
(NUMBERP (CADR (EVAL$ 'LIST V A)))),
which we generalize by replacing (EVAL$ (QUOTE LIST) V A) by Y. We must
thus prove:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST Y 0))
(CAAR (PAIRLIST Y 0))
(CADR (PAIRLIST Y 0))
(NOT (NUMBERP (CDAR (PAIRLIST Y 0))))
(EQUAL (CAADR (PAIRLIST Y 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR Y))
(NUMBERP (CADR Y))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Y by (CONS W D) to
eliminate (CAR Y) and (CDR Y) and D by (CONS C X1) to eliminate (CAR D)
and (CDR D). We must thus prove three new conjectures:
Case 1.3.3.
(IMPLIES (AND (NOT (LISTP Y))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST Y 0))
(CAAR (PAIRLIST Y 0))
(CADR (PAIRLIST Y 0))
(NOT (NUMBERP (CDAR (PAIRLIST Y 0))))
(EQUAL (CAADR (PAIRLIST Y 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR Y))
(NUMBERP (CADR Y))),
which finally simplifies, expanding the definitions of PAIRLIST, CAR,
CDR, and NUMBERP, to:
T.
Case 1.3.2.
(IMPLIES (AND (NOT (LISTP D))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W D) 0))
(CAAR (PAIRLIST (CONS W D) 0))
(CADR (PAIRLIST (CONS W D) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (CONS W D) 0))))
(EQUAL (CAADR (PAIRLIST (CONS W D) 0))
(EVAL$ T (PLUS-TREE X) A))
W)
(NUMBERP (CAR D))),
which finally simplifies, rewriting with CDR-CONS and CAR-CONS, and
expanding the definitions of CDR, CAR, PAIRLIST, and NUMBERP, to:
T.
Case 1.3.1.
(IMPLIES
(AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W (CONS C X1)) 0))
(CAAR (PAIRLIST (CONS W (CONS C X1)) 0))
(CADR (PAIRLIST (CONS W (CONS C X1)) 0))
(NOT (NUMBERP (CDAR (PAIRLIST (CONS W (CONS C X1)) 0))))
(EQUAL (CAADR (PAIRLIST (CONS W (CONS C X1)) 0))
(EVAL$ T (PLUS-TREE X) A))
W)
(NUMBERP C)).
However this finally simplifies, rewriting with CDR-CONS and CAR-CONS,
and expanding the functions CDR, CAR, PAIRLIST, and NUMBERP, to:
T.
Case 1.2.
(IMPLIES
(AND
(NOT (LITATOM Z))
(LISTP Z)
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL
(CAR
(CONS (CAADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(ADD1 (PLUS (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CDADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST (CDR Z) A))))
(NUMBERP (CADDR (EVAL$ 'LIST (CDR Z) A)))).
But this again simplifies, rewriting with CAR-CONS, and opening up the
definition of EQUAL, to:
(IMPLIES (AND (LISTP Z)
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL (CAADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST (CDR Z) A))))
(NUMBERP (CADDR (EVAL$ 'LIST (CDR Z) A)))).
Applying the lemma CAR-CDR-ELIM, replace Z by (CONS W V) to eliminate
(CDR Z) and (CAR Z). We thus obtain the new conjecture:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(EQUAL W 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(CAAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(CADR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL (CAADR (PAIRLIST (EVAL$ 'LIST V A) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST V A))))
(NUMBERP (CADDR (EVAL$ 'LIST V A)))),
which further simplifies, clearly, to:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(CAAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(CADR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL (CAADR (PAIRLIST (EVAL$ 'LIST V A) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR (EVAL$ 'LIST V A))))
(NUMBERP (CADDR (EVAL$ 'LIST V A)))),
which we generalize by replacing (EVAL$ (QUOTE LIST) V A) by Y. This
generates:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST Y 0))
(CAAR (PAIRLIST Y 0))
(CADR (PAIRLIST Y 0))
(NUMBERP (CDAR (PAIRLIST Y 0)))
(EQUAL (CAADR (PAIRLIST Y 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR Y)))
(NUMBERP (CADDR Y))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Y by (CONS W D) to
eliminate (CAR Y) and (CDR Y), D by (CONS X1 C) to eliminate (CDR D) and
(CAR D), and C by (CONS D Z1) to eliminate (CAR C) and (CDR C). The
result is four new goals:
Case 1.2.4.
(IMPLIES (AND (NOT (LISTP Y))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST Y 0))
(CAAR (PAIRLIST Y 0))
(CADR (PAIRLIST Y 0))
(NUMBERP (CDAR (PAIRLIST Y 0)))
(EQUAL (CAADR (PAIRLIST Y 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT (CAR Y)))
(NUMBERP (CADDR Y))),
which finally simplifies, appealing to the lemma CAR-NLISTP, and
expanding PAIRLIST, CAR, CDR, and NUMBERP, to:
T.
Case 1.2.3.
(IMPLIES (AND (NOT (LISTP D))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W D) 0))
(CAAR (PAIRLIST (CONS W D) 0))
(CADR (PAIRLIST (CONS W D) 0))
(NUMBERP (CDAR (PAIRLIST (CONS W D) 0)))
(EQUAL (CAADR (PAIRLIST (CONS W D) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP (CADR D))),
which finally simplifies, rewriting with CDR-CONS and CAR-CONS, and
opening up the definitions of CDR, CONS, CAR, and PAIRLIST, to:
T.
Case 1.2.2.
(IMPLIES (AND (NOT (LISTP C))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W (CONS X1 C)) 0))
(CAAR (PAIRLIST (CONS W (CONS X1 C)) 0))
(CADR (PAIRLIST (CONS W (CONS X1 C)) 0))
(NUMBERP (CDAR (PAIRLIST (CONS W (CONS X1 C)) 0)))
(EQUAL (CAADR (PAIRLIST (CONS W (CONS X1 C)) 0))
(EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP (CAR C))).
This finally simplifies, applying CDR-CONS and CAR-CONS, and unfolding
the functions CDR, CONS, CAR, and PAIRLIST, to:
T.
Case 1.2.1.
(IMPLIES
(AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))
(CAAR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))
(CADR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))
(NUMBERP (CDAR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0)))
(EQUAL (CAADR (PAIRLIST (CONS W (CONS X1 (CONS D Z1)))
0))
(EVAL$ T (PLUS-TREE X) A))
(NOT W))
(NUMBERP D)).
But this finally simplifies, rewriting with CDR-CONS and CAR-CONS, and
expanding the definitions of CDR, CONS, CAR, and PAIRLIST, to:
T.
Case 1.1.
(IMPLIES
(AND
(NOT (LITATOM Z))
(LISTP Z)
(NOT (EQUAL (CAR Z) 'QUOTE))
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL
(CAR
(CONS (CAADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(ADD1 (PLUS (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CDADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0))))))
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST (CDR Z) A)))
(NUMBERP (CADR (EVAL$ 'LIST (CDR Z) A)))).
But this again simplifies, rewriting with CAR-CONS, and expanding EQUAL,
to:
(IMPLIES (AND (LISTP Z)
(NUMBERP (EVAL$ T (CDR Z) A))
(EQUAL (CAR Z) 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CAAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(CADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST (CDR Z) A)
0)))
(EQUAL (CAADR (PAIRLIST (EVAL$ 'LIST (CDR Z) A) 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST (CDR Z) A)))
(NUMBERP (CADR (EVAL$ 'LIST (CDR Z) A)))).
Applying the lemma CAR-CDR-ELIM, replace Z by (CONS W V) to eliminate
(CDR Z) and (CAR Z). We would thus like to prove the new conjecture:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(EQUAL W 'IF)
(CAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(CAAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(CADR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL (CAADR (PAIRLIST (EVAL$ 'LIST V A) 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST V A)))
(NUMBERP (CADR (EVAL$ 'LIST V A)))),
which further simplifies, clearly, to:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(CAAR (PAIRLIST (EVAL$ 'LIST V A) 0))
(CADR (PAIRLIST (EVAL$ 'LIST V A) 0))
(NUMBERP (CDAR (PAIRLIST (EVAL$ 'LIST V A) 0)))
(EQUAL (CAADR (PAIRLIST (EVAL$ 'LIST V A) 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR (EVAL$ 'LIST V A)))
(NUMBERP (CADR (EVAL$ 'LIST V A)))),
which we generalize by replacing (EVAL$ (QUOTE LIST) V A) by Y. This
generates the goal:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST Y 0))
(CAAR (PAIRLIST Y 0))
(CADR (PAIRLIST Y 0))
(NUMBERP (CDAR (PAIRLIST Y 0)))
(EQUAL (CAADR (PAIRLIST Y 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR Y))
(NUMBERP (CADR Y))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Y by (CONS W D) to
eliminate (CAR Y) and (CDR Y) and D by (CONS C X1) to eliminate (CAR D)
and (CDR D). We must thus prove three new conjectures:
Case 1.1.3.
(IMPLIES (AND (NOT (LISTP Y))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST Y 0))
(CAAR (PAIRLIST Y 0))
(CADR (PAIRLIST Y 0))
(NUMBERP (CDAR (PAIRLIST Y 0)))
(EQUAL (CAADR (PAIRLIST Y 0))
(EVAL$ T (PLUS-TREE X) A))
(CAR Y))
(NUMBERP (CADR Y))),
which finally simplifies, rewriting with CAR-NLISTP and CDR-NLISTP, and
opening up the definitions of PAIRLIST, CAR, CDR, and NUMBERP, to:
T.
Case 1.1.2.
(IMPLIES (AND (NOT (LISTP D))
(NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W D) 0))
(CAAR (PAIRLIST (CONS W D) 0))
(CADR (PAIRLIST (CONS W D) 0))
(NUMBERP (CDAR (PAIRLIST (CONS W D) 0)))
(EQUAL (CAADR (PAIRLIST (CONS W D) 0))
(EVAL$ T (PLUS-TREE X) A))
W)
(NUMBERP (CAR D))).
This finally simplifies, rewriting with CDR-CONS, CAR-CONS, and
CAR-NLISTP, and expanding the functions CDR, CAR, PAIRLIST, and NUMBERP,
to:
T.
Case 1.1.1.
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(CAR (PAIRLIST (CONS W (CONS C X1)) 0))
(CAAR (PAIRLIST (CONS W (CONS C X1)) 0))
(CADR (PAIRLIST (CONS W (CONS C X1)) 0))
(NUMBERP (CDAR (PAIRLIST (CONS W (CONS C X1)) 0)))
(EQUAL (CAADR (PAIRLIST (CONS W (CONS C X1)) 0))
(EVAL$ T (PLUS-TREE X) A))
W)
(NUMBERP C)).
However this further simplifies, appealing to the lemmas CDR-CONS and
CAR-CONS, and unfolding CDR, CAR, PAIRLIST, and NUMBERP, to:
(IMPLIES (AND (NUMBERP (EVAL$ T V A))
(EQUAL C (EVAL$ T (PLUS-TREE X) A))
W)
(NUMBERP C)).
However this finally simplifies, applying NUMBERP-EVAL$-PLUS-TREE, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 4.9 0.4 ]
NUMBERP-EVAL$-BRIDGE
(DISABLE NUMBERP-EVAL$-BRIDGE)
[ 0.0 0.0 0.0 ]
NUMBERP-EVAL$-BRIDGE-OFF
(LEMMA BRIDGE-TO-SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP
(REWRITE)
(IMPLIES (AND (SUBBAGP Y (PLUS-FRINGE Z))
(EQUAL (EVAL$ T Z A)
(EVAL$ T
(PLUS-TREE (PLUS-FRINGE Z))
A)))
(EQUAL (LESSP (EVAL$ T Z A)
(EVAL$ T (PLUS-TREE Y) A))
F))
((ENABLE SUBBAGP PLUS-FRINGE PLUS-TREE
SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP)))
This conjecture simplifies, using linear arithmetic and applying
SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP, to:
T.
Q.E.D.
[ 0.0 0.2 0.0 ]
BRIDGE-TO-SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP
(DISABLE BRIDGE-TO-SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP)
[ 0.0 0.0 0.0 ]
BRIDGE-TO-SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP-OFF
(LEMMA EVAL$-PLUS-TREE-APPEND
(REWRITE)
(EQUAL (EVAL$ T (PLUS-TREE (APPEND X Y)) A)
(PLUS (EVAL$ T (PLUS-TREE X) A)
(EVAL$ T (PLUS-TREE Y) A)))
((ENABLE PLUS-ZERO-ARG2 COMMUTATIVITY2-OF-PLUS COMMUTATIVITY-OF-PLUS
EQUAL-PLUS-0 PLUS-CANCELLATION PLUS-TREE
NUMBERP-EVAL$-PLUS-TREE NUMBERP-EVAL$-BRIDGE)))
Name the conjecture *1.
We will appeal to induction. The recursive terms in the conjecture
suggest three inductions. They merge into two likely candidate inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LISTP X) (p (CDR X) Y A))
(p X Y A))
(IMPLIES (NOT (LISTP X)) (p X Y A))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme generates the following two new
conjectures:
Case 2. (IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(PLUS (EVAL$ T (PLUS-TREE (CDR X)) A)
(EVAL$ T (PLUS-TREE Y) A))))
(EQUAL (EVAL$ T (PLUS-TREE (APPEND X Y)) A)
(PLUS (EVAL$ T (PLUS-TREE X) A)
(EVAL$ T (PLUS-TREE Y) A)))).
This simplifies, rewriting with COMMUTATIVITY-OF-PLUS, CAR-CONS, and
CDR-CONS, and expanding APPEND and PLUS-TREE, to nine new formulas:
Case 2.9.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(NOT (LISTP (APPEND (CDR X) Y))))
(EQUAL (EVAL$ T (LIST 'FIX (CAR X)) A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (LIST 'FIX (CAR X)) A)))),
which again simplifies, appealing to the lemmas NUMBERP-EVAL$-PLUS-TREE,
EQUAL-PLUS-0, REWRITE-EVAL$, and CAR-CONS, and expanding the definitions
of PLUS-TREE, CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$, FIX, and PLUS, to:
T.
Case 2.8.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(LISTP (CDR (APPEND (CDR X) Y))))
(EQUAL (EVAL$ T
(LIST 'PLUS
(CAR X)
(PLUS-TREE (APPEND (CDR X) Y)))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (LIST 'FIX (CAR X)) A)))),
which again simplifies, applying REWRITE-EVAL$, CAR-CONS, and CDR-CONS,
and expanding the definition of FIX, to the following two new goals:
Case 2.8.2.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(LISTP (CDR (APPEND (CDR X) Y)))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL (PLUS (EVAL$ T (CAR X) A)
(EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A))
(PLUS (EVAL$ T (PLUS-TREE Y) A) 0))).
This again simplifies, applying NUMBERP-EVAL$-PLUS-TREE and
PLUS-ZERO-ARG2, and opening up PLUS and ZEROP, to:
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(LISTP (CDR (APPEND (CDR X) Y)))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(EVAL$ T (PLUS-TREE Y) A))),
which further simplifies, appealing to the lemmas
NUMBERP-EVAL$-PLUS-TREE and PLUS-ZERO-ARG2, and expanding APPEND,
PLUS-TREE, CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$, and ZEROP, to:
T.
Case 2.8.1.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(LISTP (CDR (APPEND (CDR X) Y)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (PLUS (EVAL$ T (CAR X) A)
(EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A))
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A)))),
which again simplifies, applying COMMUTATIVITY-OF-PLUS,
NUMBERP-EVAL$-PLUS-TREE, and PLUS-CANCELLATION, to the new formula:
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(LISTP (CDR (APPEND (CDR X) Y)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(EVAL$ T (PLUS-TREE Y) A))),
which further simplifies, rewriting with NUMBERP-EVAL$-PLUS-TREE and
PLUS-ZERO-ARG2, and unfolding APPEND, PLUS-TREE, CDR, CAR, LISTP,
LITATOM, EQUAL, EVAL$, and ZEROP, to:
T.
Case 2.7.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y)))))
(EQUAL (EVAL$ T
(LIST 'PLUS
(CAR X)
(CAR (APPEND (CDR X) Y)))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (LIST 'FIX (CAR X)) A)))).
However this again simplifies, rewriting with REWRITE-EVAL$, CAR-CONS,
CDR-CONS, and PLUS-ZERO-ARG2, and opening up the definitions of PLUS-TREE,
FIX, and ZEROP, to the following four new formulas:
Case 2.7.4.
(IMPLIES (AND (LISTP X)
(NOT (NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A)))
(EQUAL 0
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL 0
(PLUS (EVAL$ T (PLUS-TREE Y) A) 0))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.7.3.
(IMPLIES (AND (LISTP X)
(NOT (NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A)))
(EQUAL 0
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T (CAR X) A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A)))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.7.2.
(IMPLIES (AND (LISTP X)
(NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A))
(EQUAL (EVAL$ T (CAR (APPEND (CDR X) Y)) A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL (PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (CAR (APPEND (CDR X) Y)) A))
(PLUS (EVAL$ T (PLUS-TREE Y) A) 0))),
which again simplifies, appealing to the lemmas NUMBERP-EVAL$-PLUS-TREE
and PLUS-ZERO-ARG2, and expanding the functions PLUS and ZEROP, to the
goal:
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T (CAR (APPEND (CDR X) Y)) A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL (EVAL$ T (CAR (APPEND (CDR X) Y)) A)
(EVAL$ T (PLUS-TREE Y) A))).
This further simplifies, rewriting with NUMBERP-EVAL$-PLUS-TREE,
PLUS-ZERO-ARG2, REWRITE-EVAL$, CAR-CONS, and NUMBERP-EVAL$-BRIDGE, and
opening up APPEND, PLUS-TREE, CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$,
ZEROP, and FIX, to:
T.
Case 2.7.1.
(IMPLIES (AND (LISTP X)
(NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A))
(EQUAL (EVAL$ T (CAR (APPEND (CDR X) Y)) A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (CAR (APPEND (CDR X) Y)) A))
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CAR X) A)))).
However this again simplifies, appealing to the lemmas
COMMUTATIVITY-OF-PLUS, NUMBERP-EVAL$-PLUS-TREE, and PLUS-CANCELLATION,
to:
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T (CAR (APPEND (CDR X) Y)) A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T (CAR (APPEND (CDR X) Y)) A)
(EVAL$ T (PLUS-TREE Y) A))).
But this further simplifies, rewriting with NUMBERP-EVAL$-PLUS-TREE,
PLUS-ZERO-ARG2, REWRITE-EVAL$, CAR-CONS, and NUMBERP-EVAL$-BRIDGE, and
opening up the functions APPEND, PLUS-TREE, CDR, CAR, LISTP, LITATOM,
EQUAL, EVAL$, ZEROP, and FIX, to:
T.
Case 2.6.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(LISTP (CDR X))
(LISTP (CDDR X))
(NOT (LISTP (APPEND (CDR X) Y))))
(EQUAL (EVAL$ T (LIST 'FIX (CAR X)) A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T
(LIST 'PLUS
(CAR X)
(PLUS-TREE (CDR X)))
A)))).
However this again simplifies, rewriting with NUMBERP-EVAL$-PLUS-TREE,
EQUAL-PLUS-0, REWRITE-EVAL$, CAR-CONS, CDR-CONS, and PLUS-ZERO-ARG2, and
expanding PLUS-TREE, CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$, FIX, ZEROP,
and PLUS, to:
T.
Case 2.5.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(LISTP (CDR X))
(LISTP (CDDR X))
(LISTP (APPEND (CDR X) Y))
(LISTP (CDR (APPEND (CDR X) Y))))
(EQUAL (EVAL$ T
(LIST 'PLUS
(CAR X)
(PLUS-TREE (APPEND (CDR X) Y)))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T
(LIST 'PLUS
(CAR X)
(PLUS-TREE (CDR X)))
A)))).
However this again simplifies, rewriting with the lemmas REWRITE-EVAL$,
CAR-CONS, CDR-CONS, and COMMUTATIVITY2-OF-PLUS, to:
T.
Case 2.4.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(LISTP (CDR X))
(LISTP (CDDR X))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y)))))
(EQUAL (EVAL$ T
(LIST 'PLUS
(CAR X)
(CAR (APPEND (CDR X) Y)))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T
(LIST 'PLUS
(CAR X)
(PLUS-TREE (CDR X)))
A)))),
which again simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, CDR-CONS,
PLUS-ZERO-ARG2, and COMMUTATIVITY2-OF-PLUS, and expanding the definitions
of PLUS-TREE, FIX, and ZEROP, to:
T.
Case 2.3.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (LISTP (APPEND (CDR X) Y))))
(EQUAL (EVAL$ T (LIST 'FIX (CAR X)) A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T
(LIST 'PLUS (CAR X) (CADR X))
A)))).
This again simplifies, rewriting with NUMBERP-EVAL$-PLUS-TREE,
EQUAL-PLUS-0, REWRITE-EVAL$, CAR-CONS, and CDR-CONS, and opening up
PLUS-TREE, CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$, and FIX, to the
following two new goals:
Case 2.3.2.
(IMPLIES (AND (LISTP X)
(EQUAL 0 (EVAL$ T (PLUS-TREE Y) A))
(EQUAL 0
(EVAL$ T (PLUS-TREE (CDR X)) A))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (LISTP (APPEND (CDR X) Y)))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL 0
(PLUS 0
(EVAL$ T (CAR X) A)
(EVAL$ T (CADR X) A)))).
However this again simplifies, expanding PLUS and EQUAL, to:
(IMPLIES (AND (LISTP X)
(EQUAL 0 (EVAL$ T (PLUS-TREE Y) A))
(EQUAL 0
(EVAL$ T (PLUS-TREE (CDR X)) A))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (LISTP (APPEND (CDR X) Y)))
(NOT (NUMBERP (EVAL$ T (CAR X) A)))
(NUMBERP (EVAL$ T (CADR X) A)))
(EQUAL 0 (EVAL$ T (CADR X) A))).
However this further simplifies, appealing to the lemmas REWRITE-EVAL$
and CAR-CONS, and expanding the functions PLUS-TREE and FIX, to:
T.
Case 2.3.1.
(IMPLIES (AND (LISTP X)
(EQUAL 0 (EVAL$ T (PLUS-TREE Y) A))
(EQUAL 0
(EVAL$ T (PLUS-TREE (CDR X)) A))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (LISTP (APPEND (CDR X) Y)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T (CAR X) A)
(PLUS 0
(EVAL$ T (CAR X) A)
(EVAL$ T (CADR X) A)))),
which again simplifies, unfolding EQUAL and PLUS, to:
(IMPLIES (AND (LISTP X)
(EQUAL 0 (EVAL$ T (PLUS-TREE Y) A))
(EQUAL 0
(EVAL$ T (PLUS-TREE (CDR X)) A))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (LISTP (APPEND (CDR X) Y)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T (CAR X) A)
(PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (CADR X) A)))).
However this further simplifies, applying REWRITE-EVAL$, CAR-CONS, and
PLUS-ZERO-ARG2, and unfolding the functions PLUS-TREE, FIX, and ZEROP,
to:
T.
Case 2.2.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(LISTP (CDR (APPEND (CDR X) Y))))
(EQUAL (EVAL$ T
(LIST 'PLUS
(CAR X)
(PLUS-TREE (APPEND (CDR X) Y)))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T
(LIST 'PLUS (CAR X) (CADR X))
A)))).
But this again simplifies, applying the lemmas REWRITE-EVAL$, CAR-CONS,
CDR-CONS, COMMUTATIVITY2-OF-PLUS, and PLUS-CANCELLATION, to:
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(LISTP (CDR (APPEND (CDR X) Y))))
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CADR X) A)))).
This further simplifies, rewriting with REWRITE-EVAL$, CAR-CONS,
NUMBERP-EVAL$-PLUS-TREE, and PLUS-ZERO-ARG2, and expanding PLUS-TREE, FIX,
and ZEROP, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(PLUS-TREE (APPEND (CDR X) Y))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y)))))
(EQUAL (EVAL$ T
(LIST 'PLUS
(CAR X)
(CAR (APPEND (CDR X) Y)))
A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T
(LIST 'PLUS (CAR X) (CADR X))
A)))).
But this again simplifies, rewriting with the lemmas REWRITE-EVAL$,
CAR-CONS, CDR-CONS, PLUS-ZERO-ARG2, COMMUTATIVITY2-OF-PLUS, and
PLUS-CANCELLATION, and expanding PLUS-TREE, FIX, and ZEROP, to three new
formulas:
Case 2.1.3.
(IMPLIES (AND (LISTP X)
(NOT (NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A)))
(EQUAL 0
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL 0
(PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CADR X) A)))),
which again simplifies, applying NUMBERP-EVAL$-PLUS-TREE and
EQUAL-PLUS-0, and unfolding the functions EQUAL and PLUS, to:
(IMPLIES (AND (LISTP X)
(NOT (NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A)))
(EQUAL 0 (EVAL$ T (PLUS-TREE Y) A))
(EQUAL 0
(EVAL$ T (PLUS-TREE (CDR X)) A))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NOT (NUMBERP (EVAL$ T (CAR X) A)))
(NUMBERP (EVAL$ T (CADR X) A)))
(EQUAL 0 (EVAL$ T (CADR X) A))),
which further simplifies, applying the lemmas REWRITE-EVAL$ and CAR-CONS,
and opening up the definitions of PLUS-TREE and FIX, to:
T.
Case 2.1.2.
(IMPLIES (AND (LISTP X)
(NOT (NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A)))
(EQUAL 0
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T (CAR X) A)
(PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CADR X) A)))),
which again simplifies, applying the lemmas NUMBERP-EVAL$-PLUS-TREE and
EQUAL-PLUS-0, and expanding EQUAL and PLUS, to two new conjectures:
Case 2.1.2.2.
(IMPLIES
(AND (LISTP X)
(NOT (NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A)))
(EQUAL 0 (EVAL$ T (PLUS-TREE Y) A))
(EQUAL 0
(EVAL$ T (PLUS-TREE (CDR X)) A))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NUMBERP (EVAL$ T (CAR X) A))
(NOT (NUMBERP (EVAL$ T (CADR X) A))))
(EQUAL (EVAL$ T (CAR X) A)
(PLUS (EVAL$ T (CAR X) A) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.2.1.
(IMPLIES
(AND (LISTP X)
(NOT (NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A)))
(EQUAL 0 (EVAL$ T (PLUS-TREE Y) A))
(EQUAL 0
(EVAL$ T (PLUS-TREE (CDR X)) A))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NUMBERP (EVAL$ T (CAR X) A))
(NUMBERP (EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T (CAR X) A)
(PLUS (EVAL$ T (CAR X) A)
(EVAL$ T (CADR X) A)))),
which further simplifies, appealing to the lemmas REWRITE-EVAL$,
CAR-CONS, and PLUS-ZERO-ARG2, and expanding PLUS-TREE, FIX, NUMBERP,
and ZEROP, to:
T.
Case 2.1.1.
(IMPLIES (AND (LISTP X)
(NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A))
(EQUAL (EVAL$ T (CAR (APPEND (CDR X) Y)) A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y)))))
(EQUAL (EVAL$ T (CAR (APPEND (CDR X) Y)) A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CADR X) A)))),
which again simplifies, clearly, to:
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T (CAR (APPEND (CDR X) Y)) A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (PLUS-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y)))))
(EQUAL (EVAL$ T (CAR (APPEND (CDR X) Y)) A)
(PLUS (EVAL$ T (PLUS-TREE Y) A)
(EVAL$ T (CADR X) A)))),
which further simplifies, appealing to the lemmas REWRITE-EVAL$,
CAR-CONS, NUMBERP-EVAL$-PLUS-TREE, and PLUS-ZERO-ARG2, and unfolding the
definitions of PLUS-TREE, FIX, and ZEROP, to:
T.
Case 1. (IMPLIES (NOT (LISTP X))
(EQUAL (EVAL$ T (PLUS-TREE (APPEND X Y)) A)
(PLUS (EVAL$ T (PLUS-TREE X) A)
(EVAL$ T (PLUS-TREE Y) A)))),
which simplifies, rewriting with NUMBERP-EVAL$-PLUS-TREE, and unfolding the
functions APPEND, PLUS-TREE, CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$, and
PLUS, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 7.9 0.1 ]
EVAL$-PLUS-TREE-APPEND
(DISABLE EVAL$-PLUS-TREE-APPEND)
[ 0.0 0.0 0.0 ]
EVAL$-PLUS-TREE-APPEND-OFF
(LEMMA PLUS-TREE-PLUS-FRINGE
(REWRITE)
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE X))
A)
(FIX (EVAL$ T X A)))
((ENABLE PLUS-ZERO-ARG2 COMMUTATIVITY-OF-PLUS PLUS-FRINGE PLUS-TREE
NUMBERP-EVAL$-PLUS NUMBERP-EVAL$-BRIDGE EVAL$-PLUS-TREE-APPEND)
(INDUCT (PLUS-FRINGE X))))
This formula can be simplified, using the abbreviations NOT, OR, and AND, to
the following two new conjectures:
Case 2. (IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'PLUS)
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADDR X)))
A)
(FIX (EVAL$ T (CADDR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADR X)))
A)
(FIX (EVAL$ T (CADR X) A))))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE X))
A)
(FIX (EVAL$ T X A)))).
This simplifies, rewriting with EVAL$-PLUS-TREE-APPEND, NUMBERP-EVAL$-PLUS,
and PLUS-ZERO-ARG2, and unfolding the definitions of FIX, EQUAL, PLUS-FRINGE,
PLUS, and ZEROP, to four new goals:
Case 2.4.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'PLUS)
(NOT (NUMBERP (EVAL$ T (CADDR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADDR X)))
A)
0)
(NOT (NUMBERP (EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADR X)))
A)
0))
(EQUAL 0 (EVAL$ T X A))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS D W) to eliminate (CDR V) and (CAR V), and
W by (CONS V C) to eliminate (CAR W) and (CDR W). This produces the
following three new goals:
Case 2.4.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'PLUS)
(NOT (NUMBERP (EVAL$ T (CADR V) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADR V)))
A)
0)
(NOT (NUMBERP (EVAL$ T (CAR V) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CAR V)))
A)
0))
(EQUAL 0 (EVAL$ T (CONS Z V) A))).
However this further simplifies, rewriting with the lemma CDR-NLISTP,
and opening up CAR, LISTP, LITATOM, EQUAL, EVAL$, and NUMBERP, to:
T.
Case 2.4.2.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL Z 'PLUS)
(NOT (NUMBERP (EVAL$ T (CAR W) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CAR W)))
A)
0)
(NOT (NUMBERP (EVAL$ T D A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE D))
A)
0))
(EQUAL 0
(EVAL$ T (CONS Z (CONS D W)) A))),
which further simplifies, applying CAR-NLISTP, and expanding the
definitions of LISTP, LITATOM, EQUAL, EVAL$, and NUMBERP, to:
T.
Case 2.4.1.
(IMPLIES (AND (EQUAL Z 'PLUS)
(NOT (NUMBERP (EVAL$ T V A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE V))
A)
0)
(NOT (NUMBERP (EVAL$ T D A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE D))
A)
0))
(EQUAL 0
(EVAL$ T
(CONS Z (CONS D (CONS V C)))
A))).
This further simplifies, appealing to the lemmas REWRITE-EVAL$, CAR-CONS,
CDR-CONS, and PLUS-ZERO-ARG2, and expanding the definitions of ZEROP and
EQUAL, to:
T.
Case 2.3.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'PLUS)
(NOT (NUMBERP (EVAL$ T (CADDR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADDR X)))
A)
0)
(NUMBERP (EVAL$ T (CADR X) A))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADR X)))
A)
(EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T (CADR X) A)
(EVAL$ T X A))),
which again simplifies, appealing to the lemma NUMBERP-EVAL$-BRIDGE, to:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'PLUS)
(NOT (NUMBERP (EVAL$ T (CADDR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADDR X)))
A)
0)
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADR X)))
A)
(EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T (CADR X) A)
(EVAL$ T X A))).
Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
eliminate (CAR X) and (CDR X), V by (CONS D W) to eliminate (CDR V) and
(CAR V), and W by (CONS V C) to eliminate (CAR W) and (CDR W). This
generates three new formulas:
Case 2.3.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'PLUS)
(NOT (NUMBERP (EVAL$ T (CADR V) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADR V)))
A)
0)
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CAR V)))
A)
(EVAL$ T (CAR V) A)))
(EQUAL (EVAL$ T (CAR V) A)
(EVAL$ T (CONS Z V) A))),
which further simplifies, rewriting with the lemma CDR-NLISTP, and
unfolding CAR, LISTP, LITATOM, EQUAL, EVAL$, and NUMBERP, to:
T.
Case 2.3.2.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL Z 'PLUS)
(NOT (NUMBERP (EVAL$ T (CAR W) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CAR W)))
A)
0)
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE D))
A)
(EVAL$ T D A)))
(EQUAL (EVAL$ T D A)
(EVAL$ T (CONS Z (CONS D W)) A))),
which further simplifies, rewriting with the lemma CAR-NLISTP, and
opening up the functions LISTP, LITATOM, EQUAL, EVAL$, and NUMBERP, to:
T.
Case 2.3.1.
(IMPLIES (AND (EQUAL Z 'PLUS)
(NOT (NUMBERP (EVAL$ T V A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE V))
A)
0)
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE D))
A)
(EVAL$ T D A)))
(EQUAL (EVAL$ T D A)
(EVAL$ T
(CONS Z (CONS D (CONS V C)))
A))),
which further simplifies, rewriting with the lemmas REWRITE-EVAL$,
CAR-CONS, CDR-CONS, NUMBERP-EVAL$-BRIDGE, and PLUS-ZERO-ARG2, and
opening up ZEROP, to:
T.
Case 2.2.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'PLUS)
(NUMBERP (EVAL$ T (CADDR X) A))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADDR X)))
A)
(EVAL$ T (CADDR X) A))
(NOT (NUMBERP (EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADR X)))
A)
0))
(EQUAL (EVAL$ T (CADDR X) A)
(EVAL$ T X A))),
which again simplifies, rewriting with NUMBERP-EVAL$-BRIDGE, to:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'PLUS)
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADDR X)))
A)
(EVAL$ T (CADDR X) A))
(NOT (NUMBERP (EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADR X)))
A)
0))
(EQUAL (EVAL$ T (CADDR X) A)
(EVAL$ T X A))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS D W) to eliminate (CDR V) and (CAR V), and
W by (CONS V C) to eliminate (CAR W) and (CDR W). This produces the
following three new formulas:
Case 2.2.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'PLUS)
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADR V)))
A)
(EVAL$ T (CADR V) A))
(NOT (NUMBERP (EVAL$ T (CAR V) A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CAR V)))
A)
0))
(EQUAL (EVAL$ T (CADR V) A)
(EVAL$ T (CONS Z V) A))).
However this further simplifies, rewriting with CDR-NLISTP,
REWRITE-EVAL$, and CAR-NLISTP, and opening up the definitions of CAR,
CONS, LISTP, PLUS-FRINGE, CDR, PLUS-TREE, LITATOM, EQUAL, EVAL$, FIX,
and NUMBERP, to:
T.
Case 2.2.2.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL Z 'PLUS)
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CAR W)))
A)
(EVAL$ T (CAR W) A))
(NOT (NUMBERP (EVAL$ T D A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE D))
A)
0))
(EQUAL (EVAL$ T (CAR W) A)
(EVAL$ T (CONS Z (CONS D W)) A))).
This further simplifies, appealing to the lemmas CAR-NLISTP,
REWRITE-EVAL$, CAR-CONS, CDR-CONS, and PLUS-ZERO-ARG2, and opening up
the definitions of CONS, LISTP, PLUS-FRINGE, CAR, CDR, PLUS-TREE,
LITATOM, EQUAL, EVAL$, FIX, and ZEROP, to:
T.
Case 2.2.1.
(IMPLIES (AND (EQUAL Z 'PLUS)
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE V))
A)
(EVAL$ T V A))
(NOT (NUMBERP (EVAL$ T D A)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE D))
A)
0))
(EQUAL (EVAL$ T V A)
(EVAL$ T
(CONS Z (CONS D (CONS V C)))
A))),
which further simplifies, rewriting with REWRITE-EVAL$, CAR-CONS,
CDR-CONS, and NUMBERP-EVAL$-BRIDGE, and opening up the function PLUS, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'PLUS)
(NUMBERP (EVAL$ T (CADDR X) A))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADDR X)))
A)
(EVAL$ T (CADDR X) A))
(NUMBERP (EVAL$ T (CADR X) A))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADR X)))
A)
(EVAL$ T (CADR X) A)))
(EQUAL (PLUS (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A))
(EVAL$ T X A))).
However this again simplifies, applying NUMBERP-EVAL$-BRIDGE, to the new
formula:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'PLUS)
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADDR X)))
A)
(EVAL$ T (CADDR X) A))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADR X)))
A)
(EVAL$ T (CADR X) A)))
(EQUAL (PLUS (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A))
(EVAL$ T X A))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS D W) to eliminate (CDR V) and (CAR V), and
W by (CONS V C) to eliminate (CAR W) and (CDR W). We thus obtain the
following three new conjectures:
Case 2.1.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'PLUS)
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CADR V)))
A)
(EVAL$ T (CADR V) A))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CAR V)))
A)
(EVAL$ T (CAR V) A)))
(EQUAL (PLUS (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A))
(EVAL$ T (CONS Z V) A))).
However this further simplifies, rewriting with CDR-NLISTP,
REWRITE-EVAL$, and CAR-NLISTP, and expanding CAR, CONS, LISTP,
PLUS-FRINGE, CDR, PLUS-TREE, LITATOM, EQUAL, EVAL$, FIX, and PLUS, to:
T.
Case 2.1.2.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL Z 'PLUS)
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE (CAR W)))
A)
(EVAL$ T (CAR W) A))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE D))
A)
(EVAL$ T D A)))
(EQUAL (PLUS (EVAL$ T D A)
(EVAL$ T (CAR W) A))
(EVAL$ T (CONS Z (CONS D W)) A))).
This further simplifies, rewriting with CAR-NLISTP, REWRITE-EVAL$,
NUMBERP-EVAL$-BRIDGE, PLUS-ZERO-ARG2, CAR-CONS, and CDR-CONS, and
expanding the functions CONS, LISTP, PLUS-FRINGE, CAR, CDR, PLUS-TREE,
LITATOM, EQUAL, EVAL$, FIX, and ZEROP, to:
T.
Case 2.1.1.
(IMPLIES (AND (EQUAL Z 'PLUS)
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE V))
A)
(EVAL$ T V A))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE D))
A)
(EVAL$ T D A)))
(EQUAL (PLUS (EVAL$ T D A) (EVAL$ T V A))
(EVAL$ T
(CONS Z (CONS D (CONS V C)))
A))).
This further simplifies, applying REWRITE-EVAL$, CAR-CONS, and CDR-CONS,
to:
T.
Case 1. (IMPLIES (NOT (AND (LISTP X)
(EQUAL (CAR X) 'PLUS)))
(EQUAL (EVAL$ T
(PLUS-TREE (PLUS-FRINGE X))
A)
(FIX (EVAL$ T X A)))).
This simplifies, applying the lemmas CAR-CONS, CDR-CONS, and REWRITE-EVAL$,
and expanding the definitions of AND, PLUS-FRINGE, LISTP, PLUS-TREE, EQUAL,
EVAL$, and FIX, to:
T.
Q.E.D.
[ 0.0 3.0 0.1 ]
PLUS-TREE-PLUS-FRINGE
(DISABLE PLUS-TREE-PLUS-FRINGE)
[ 0.0 0.0 0.0 ]
PLUS-TREE-PLUS-FRINGE-OFF
(LEMMA MEMBER-IMPLIES-NUMBERP
(REWRITE)
(IMPLIES (AND (MEMBER C (PLUS-FRINGE X))
(NUMBERP (EVAL$ T C A)))
(NUMBERP (EVAL$ T X A)))
((ENABLE PLUS-FRINGE NUMBERP-EVAL$-PLUS)
(INDUCT (PLUS-FRINGE X))))
WARNING: Note that MEMBER-IMPLIES-NUMBERP contains the free variable C which
will be chosen by instantiating the hypothesis (MEMBER C (PLUS-FRINGE X)).
This formula can be simplified, using the abbreviations IMPLIES, NOT, OR, and
AND, to the following two new formulas:
Case 2. (IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'PLUS)
(IMPLIES (AND (MEMBER C (PLUS-FRINGE (CADDR X)))
(NUMBERP (EVAL$ T C A)))
(NUMBERP (EVAL$ T (CADDR X) A)))
(IMPLIES (AND (MEMBER C (PLUS-FRINGE (CADR X)))
(NUMBERP (EVAL$ T C A)))
(NUMBERP (EVAL$ T (CADR X) A)))
(MEMBER C (PLUS-FRINGE X))
(NUMBERP (EVAL$ T C A)))
(NUMBERP (EVAL$ T X A))).
This simplifies, applying NUMBERP-EVAL$-PLUS, and unfolding the definitions
of AND, IMPLIES, EQUAL, and PLUS-FRINGE, to:
T.
Case 1. (IMPLIES (AND (NOT (AND (LISTP X)
(EQUAL (CAR X) 'PLUS)))
(MEMBER C (PLUS-FRINGE X))
(NUMBERP (EVAL$ T C A)))
(NUMBERP (EVAL$ T X A))),
which simplifies, rewriting with CDR-CONS and CAR-CONS, and opening up the
definitions of AND, PLUS-FRINGE, MEMBER, LISTP, EQUAL, and EVAL$, to:
T.
Q.E.D.
[ 0.0 0.2 0.0 ]
MEMBER-IMPLIES-NUMBERP
(DISABLE MEMBER-IMPLIES-NUMBERP)
[ 0.0 0.0 0.0 ]
MEMBER-IMPLIES-NUMBERP-OFF
(LEMMA CADR-EVAL$-LIST
(REWRITE)
(AND (EQUAL (CAR (EVAL$ 'LIST X A))
(EVAL$ T (CAR X) A))
(EQUAL (CDR (EVAL$ 'LIST X A))
(IF (LISTP X)
(EVAL$ 'LIST (CDR X) A)
0))))
WARNING: Note that the proposed lemma CADR-EVAL$-LIST is to be stored as zero
type prescription rules, zero compound recognizer rules, zero linear rules,
and two replacement rules.
This formula can be simplified, using the abbreviation AND, to the following
two new conjectures:
Case 2. (EQUAL (CAR (EVAL$ 'LIST X A))
(EVAL$ T (CAR X) A)).
Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
eliminate (CAR X) and (CDR X). We must thus prove two new goals:
Case 2.2.
(IMPLIES (NOT (LISTP X))
(EQUAL (CAR (EVAL$ 'LIST X A))
(EVAL$ T (CAR X) A))),
which simplifies, rewriting with CAR-NLISTP, and unfolding the functions
EQUAL, EVAL$, CAR, LISTP, and LITATOM, to:
T.
Case 2.1.
(EQUAL (CAR (EVAL$ 'LIST (CONS Z V) A))
(EVAL$ T Z A)).
However this simplifies, applying CDR-CONS and CAR-CONS, and unfolding the
definitions of EQUAL and EVAL$, to:
T.
Case 1. (EQUAL (CDR (EVAL$ 'LIST X A))
(IF (LISTP X)
(EVAL$ 'LIST (CDR X) A)
0)).
This simplifies, trivially, to the following two new conjectures:
Case 1.2.
(IMPLIES (NOT (LISTP X))
(EQUAL (CDR (EVAL$ 'LIST X A)) 0)).
However this again simplifies, unfolding the functions EQUAL, EVAL$, and
CDR, to:
T.
Case 1.1.
(IMPLIES (LISTP X)
(EQUAL (CDR (EVAL$ 'LIST X A))
(EVAL$ 'LIST (CDR X) A))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS V Z) to eliminate
(CDR X) and (CAR X). We would thus like to prove:
(EQUAL (CDR (EVAL$ 'LIST (CONS V Z) A))
(EVAL$ 'LIST Z A)),
which further simplifies, appealing to the lemmas CDR-CONS and CAR-CONS,
and expanding EQUAL and EVAL$, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CADR-EVAL$-LIST
(DISABLE CADR-EVAL$-LIST)
[ 0.0 0.0 0.0 ]
CADR-EVAL$-LIST-OFF
(LEMMA EVAL$-QUOTE
(REWRITE)
(EQUAL (EVAL$ T (CONS 'QUOTE ARGS) A)
(CAR ARGS)))
This conjecture simplifies, rewriting with CDR-CONS and CAR-CONS, and
unfolding EQUAL and EVAL$, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EVAL$-QUOTE
(DISABLE EVAL$-QUOTE)
[ 0.0 0.0 0.0 ]
EVAL$-QUOTE-OFF
(LEMMA LISTP-EVAL$
(REWRITE)
(EQUAL (LISTP (EVAL$ 'LIST X A))
(LISTP X)))
Name the conjecture *1.
We will appeal to induction. There is only one plausible induction. We
will induct according to the following scheme:
(AND (IMPLIES (AND (EQUAL 'LIST 'LIST) (NLISTP X))
(p X A))
(IMPLIES (AND (EQUAL 'LIST 'LIST)
(NOT (NLISTP X))
(p (CDR X) A)
(p (CAR X) A))
(p X A))
(IMPLIES (AND (NOT (EQUAL 'LIST 'LIST))
(LITATOM X))
(p X A))
(IMPLIES (AND (NOT (EQUAL 'LIST 'LIST))
(NOT (LITATOM X))
(NLISTP X))
(p X A))
(IMPLIES (AND (NOT (EQUAL 'LIST 'LIST))
(NOT (LITATOM X))
(NOT (NLISTP X))
(EQUAL (CAR X) 'QUOTE))
(p X A))
(IMPLIES (AND (NOT (EQUAL 'LIST 'LIST))
(NOT (LITATOM X))
(NOT (NLISTP X))
(NOT (EQUAL (CAR X) 'QUOTE))
(p (CDR X) A))
(p X A))).
Linear arithmetic, the lemmas CDR-LESSEQP, CDR-LESSP, CAR-LESSEQP, and
CAR-LESSP, and the definition of NLISTP inform us that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme produces the following six new
formulas:
Case 6. (IMPLIES (AND (EQUAL 'LIST 'LIST) (NLISTP X))
(EQUAL (LISTP (EVAL$ 'LIST X A))
(LISTP X))).
This simplifies, expanding the definitions of EQUAL, NLISTP, EVAL$, and
LISTP, to:
T.
Case 5. (IMPLIES (AND (EQUAL 'LIST 'LIST)
(NOT (NLISTP X))
(EQUAL (LISTP (EVAL$ 'LIST (CDR X) A))
(LISTP (CDR X)))
(EQUAL (LISTP (EVAL$ 'LIST (CAR X) A))
(LISTP (CAR X))))
(EQUAL (LISTP (EVAL$ 'LIST X A))
(LISTP X))).
This simplifies, expanding the definitions of EQUAL, NLISTP, and EVAL$, to:
T.
Case 4. (IMPLIES (AND (NOT (EQUAL 'LIST 'LIST))
(LITATOM X))
(EQUAL (LISTP (EVAL$ 'LIST X A))
(LISTP X))).
This simplifies, trivially, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL 'LIST 'LIST))
(NOT (LITATOM X))
(NLISTP X))
(EQUAL (LISTP (EVAL$ 'LIST X A))
(LISTP X))).
This simplifies, trivially, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL 'LIST 'LIST))
(NOT (LITATOM X))
(NOT (NLISTP X))
(EQUAL (CAR X) 'QUOTE))
(EQUAL (LISTP (EVAL$ 'LIST X A))
(LISTP X))).
This simplifies, obviously, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL 'LIST 'LIST))
(NOT (LITATOM X))
(NOT (NLISTP X))
(NOT (EQUAL (CAR X) 'QUOTE))
(EQUAL (LISTP (EVAL$ 'LIST (CDR X) A))
(LISTP (CDR X))))
(EQUAL (LISTP (EVAL$ 'LIST X A))
(LISTP X))).
This simplifies, obviously, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LISTP-EVAL$
(DISABLE LISTP-EVAL$)
[ 0.0 0.0 0.0 ]
LISTP-EVAL$-OFF
(DEFN CANCEL-EQUAL-PLUS
(X)
(IF (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL))
(IF (AND (LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS))
(LIST 'EQUAL
(PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADR X))
(BAGINT (PLUS-FRINGE (CADR X))
(PLUS-FRINGE (CADDR X)))))
(PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADDR X))
(BAGINT (PLUS-FRINGE (CADR X))
(PLUS-FRINGE (CADDR X))))))
(IF (AND (LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X))))
(LIST 'IF
(LIST 'NUMBERP (CADDR X))
(LIST 'EQUAL
(PLUS-TREE (DELETE (CADDR X)
(PLUS-FRINGE (CADR X))))
''0)
(LIST 'QUOTE F))
(IF (AND (LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X))))
(LIST 'IF
(LIST 'NUMBERP (CADR X))
(LIST 'EQUAL
''0
(PLUS-TREE (DELETE (CADR X)
(PLUS-FRINGE (CADDR X)))))
(LIST 'QUOTE F))
X)))
X))
From the definition we can conclude that:
(OR (LISTP (CANCEL-EQUAL-PLUS X))
(EQUAL (CANCEL-EQUAL-PLUS X) X))
is a theorem.
[ 0.0 0.0 0.0 ]
CANCEL-EQUAL-PLUS
(LEMMA CORRECTNESS-OF-CANCEL-EQUAL-PLUS
((META EQUAL))
(EQUAL (EVAL$ T X A)
(EVAL$ T (CANCEL-EQUAL-PLUS X) A))
((ENABLE BRIDGE-TO-SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP
CANCEL-EQUAL-PLUS DIFFERENCE-CANCELLATION EQUAL-DIFFERENCE-0
EVAL$-QUOTE MEMBER-IMPLIES-NUMBERP
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP NUMBERP-EVAL$-PLUS
PLUS-TREE-BAGDIFF PLUS-TREE-DELETE PLUS-TREE-PLUS-FRINGE
SUBBAGP-BAGINT1 SUBBAGP-BAGINT2)
(DISABLE EVAL$)))
This formula simplifies, opening up the function CANCEL-EQUAL-PLUS, to the
following five new goals:
Case 5. (IMPLIES
(AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(NOT (EQUAL (CAADR X) 'PLUS))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X))))
(EQUAL
(EVAL$ T X A)
(EVAL$ T
(LIST 'IF
(LIST 'NUMBERP (CADR X))
(LIST 'EQUAL
''0
(PLUS-TREE (DELETE (CADR X)
(PLUS-FRINGE (CADDR X)))))
(LIST 'QUOTE F))
A))).
However this again simplifies, rewriting with REWRITE-EVAL$, CAR-CONS,
CDR-CONS, EVAL$-QUOTE, MEMBER-IMPLIES-NUMBERP, PLUS-TREE-PLUS-FRINGE,
PLUS-TREE-DELETE, and EQUAL-DIFFERENCE-0, and opening up CAR, to the
following three new formulas:
Case 5.3.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(NOT (EQUAL (CAADR X) 'PLUS))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X)))
(LESSP (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))
(EQUAL (EVAL$ T X A) F)).
This again simplifies, clearly, to the new goal:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(NOT (EQUAL (CAADR X) 'PLUS))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X)))
(LESSP (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))
(NOT (EVAL$ T X A))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), W
by (CONS V C) to eliminate (CAR W) and (CDR W), D by (CONS W X1) to
eliminate (CAR D) and (CDR D), W by (CONS D Z1) to eliminate (CAR W) and
(CDR W), D by (CONS V C) to eliminate (CAR D) and (CDR D), and V by
(CONS D X1) to eliminate (CAR V) and (CDR V). We would thus like to prove
the following five new goals:
Case 5.3.5.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'EQUAL)
(NOT (EQUAL (CAAR V) 'PLUS))
(LISTP (CADR V))
(EQUAL (CAADR V) 'PLUS)
(MEMBER (CAR V)
(PLUS-FRINGE (CADR V)))
(LESSP (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A)))
(NOT (EVAL$ T (CONS Z V) A))).
This further simplifies, rewriting with CAR-NLISTP and CDR-NLISTP, and
opening up the functions CAR, EQUAL, and LISTP, to:
T.
Case 5.3.4.
(IMPLIES (AND (NOT (LISTP D))
(NOT (LISTP W))
(EQUAL Z 'EQUAL)
(NOT (EQUAL (CAR W) 'PLUS))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER W (PLUS-FRINGE (CAR D)))
(LESSP (EVAL$ T W A)
(EVAL$ T (CAR D) A)))
(NOT (EVAL$ T (CONS Z (CONS W D)) A))).
But this further simplifies, appealing to the lemma CAR-NLISTP, and
opening up the functions EQUAL and LISTP, to:
T.
Case 5.3.3.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL Z 'EQUAL)
(NOT (EQUAL (CAR W) 'PLUS))
(EQUAL D 'PLUS)
(MEMBER W (PLUS-FRINGE (CONS D X1)))
(LESSP (EVAL$ T W A)
(EVAL$ T (CONS D X1) A)))
(NOT (EVAL$ T
(CONS Z (CONS W (CONS (CONS D X1) C)))
A))),
which further simplifies, appealing to the lemmas CAR-NLISTP,
REWRITE-EVAL$, CAR-CONS, and CDR-CONS, and expanding EQUAL, to the goal:
(IMPLIES (AND (NOT (LISTP W))
(MEMBER W
(PLUS-FRINGE (CONS 'PLUS X1)))
(LESSP (EVAL$ T W A)
(PLUS (EVAL$ T (CAR X1) A)
(EVAL$ T (CADR X1) A))))
(NOT (EQUAL (EVAL$ T W A)
(PLUS (EVAL$ T (CAR X1) A)
(EVAL$ T (CADR X1) A))))).
However this finally simplifies, using linear arithmetic, to:
T.
Case 5.3.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'EQUAL)
(NOT (EQUAL V 'PLUS))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER (CONS V C)
(PLUS-FRINGE (CAR D)))
(LESSP (EVAL$ T (CONS V C) A)
(EVAL$ T (CAR D) A)))
(NOT (EVAL$ T
(CONS Z (CONS (CONS V C) D))
A))),
which further simplifies, applying CAR-NLISTP, and opening up the
definition of LISTP, to:
T.
Case 5.3.1.
(IMPLIES (AND (EQUAL Z 'EQUAL)
(NOT (EQUAL V 'PLUS))
(EQUAL D 'PLUS)
(MEMBER (CONS V C)
(PLUS-FRINGE (CONS D Z1)))
(LESSP (EVAL$ T (CONS V C) A)
(EVAL$ T (CONS D Z1) A)))
(NOT (EVAL$ T
(CONS Z
(CONS (CONS V C)
(CONS (CONS D Z1) X1)))
A))).
However this further simplifies, applying REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, to:
(IMPLIES (AND (NOT (EQUAL V 'PLUS))
(MEMBER (CONS V C)
(PLUS-FRINGE (CONS 'PLUS Z1)))
(LESSP (EVAL$ T (CONS V C) A)
(PLUS (EVAL$ T (CAR Z1) A)
(EVAL$ T (CADR Z1) A))))
(NOT (EQUAL (EVAL$ T (CONS V C) A)
(PLUS (EVAL$ T (CAR Z1) A)
(EVAL$ T (CADR Z1) A))))),
which finally simplifies, using linear arithmetic, to:
T.
Case 5.2.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(NOT (EQUAL (CAADR X) 'PLUS))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X)))
(NOT (NUMBERP (EVAL$ T (CADR X) A))))
(EQUAL (EVAL$ T X A) F)),
which again simplifies, trivially, to:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(NOT (EQUAL (CAADR X) 'PLUS))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X)))
(NOT (NUMBERP (EVAL$ T (CADR X) A))))
(NOT (EVAL$ T X A))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), W
by (CONS V C) to eliminate (CAR W) and (CDR W), D by (CONS W X1) to
eliminate (CAR D) and (CDR D), W by (CONS D Z1) to eliminate (CAR W) and
(CDR W), D by (CONS V C) to eliminate (CAR D) and (CDR D), and V by
(CONS D X1) to eliminate (CAR V) and (CDR V). We thus obtain the
following five new conjectures:
Case 5.2.5.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'EQUAL)
(NOT (EQUAL (CAAR V) 'PLUS))
(LISTP (CADR V))
(EQUAL (CAADR V) 'PLUS)
(MEMBER (CAR V)
(PLUS-FRINGE (CADR V)))
(NOT (NUMBERP (EVAL$ T (CAR V) A))))
(NOT (EVAL$ T (CONS Z V) A))).
But this further simplifies, rewriting with CAR-NLISTP and CDR-NLISTP,
and unfolding the definitions of CAR, EQUAL, and LISTP, to:
T.
Case 5.2.4.
(IMPLIES (AND (NOT (LISTP D))
(NOT (LISTP W))
(EQUAL Z 'EQUAL)
(NOT (EQUAL (CAR W) 'PLUS))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER W (PLUS-FRINGE (CAR D)))
(NOT (NUMBERP (EVAL$ T W A))))
(NOT (EVAL$ T (CONS Z (CONS W D)) A))).
This further simplifies, applying CAR-NLISTP, and unfolding EQUAL and
LISTP, to:
T.
Case 5.2.3.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL Z 'EQUAL)
(NOT (EQUAL (CAR W) 'PLUS))
(EQUAL D 'PLUS)
(MEMBER W (PLUS-FRINGE (CONS D X1)))
(NOT (NUMBERP (EVAL$ T W A))))
(NOT (EVAL$ T
(CONS Z (CONS W (CONS (CONS D X1) C)))
A))).
However this further simplifies, rewriting with the lemmas CAR-NLISTP,
REWRITE-EVAL$, CAR-CONS, and CDR-CONS, and expanding the function EQUAL,
to:
T.
Case 5.2.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'EQUAL)
(NOT (EQUAL V 'PLUS))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER (CONS V C)
(PLUS-FRINGE (CAR D)))
(NOT (NUMBERP (EVAL$ T (CONS V C) A))))
(NOT (EVAL$ T
(CONS Z (CONS (CONS V C) D))
A))),
which further simplifies, applying CAR-NLISTP, and expanding the
function LISTP, to:
T.
Case 5.2.1.
(IMPLIES (AND (EQUAL Z 'EQUAL)
(NOT (EQUAL V 'PLUS))
(EQUAL D 'PLUS)
(MEMBER (CONS V C)
(PLUS-FRINGE (CONS D Z1)))
(NOT (NUMBERP (EVAL$ T (CONS V C) A))))
(NOT (EVAL$ T
(CONS Z
(CONS (CONS V C)
(CONS (CONS D Z1) X1)))
A))).
However this further simplifies, rewriting with REWRITE-EVAL$, CAR-CONS,
and CDR-CONS, to:
T.
Case 5.1.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(NOT (EQUAL (CAADR X) 'PLUS))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X)))
(NUMBERP (EVAL$ T (CADR X) A))
(NOT (LESSP (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A))))
(EQUAL (EVAL$ T X A) T)).
Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and
(CDR V), W by (CONS V C) to eliminate (CAR W) and (CDR W), D by
(CONS W X1) to eliminate (CAR D) and (CDR D), W by (CONS D Z1) to
eliminate (CAR W) and (CDR W), D by (CONS V C) to eliminate (CAR D) and
(CDR D), and V by (CONS D X1) to eliminate (CAR V) and (CDR V). We must
thus prove five new conjectures:
Case 5.1.5.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'EQUAL)
(NOT (EQUAL (CAAR V) 'PLUS))
(LISTP (CADR V))
(EQUAL (CAADR V) 'PLUS)
(MEMBER (CAR V)
(PLUS-FRINGE (CADR V)))
(NUMBERP (EVAL$ T (CAR V) A))
(NOT (LESSP (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A))))
(EQUAL (EVAL$ T (CONS Z V) A) T)),
which further simplifies, applying CAR-NLISTP and CDR-NLISTP, and
unfolding CAR, EQUAL, and LISTP, to:
T.
Case 5.1.4.
(IMPLIES (AND (NOT (LISTP D))
(NOT (LISTP W))
(EQUAL Z 'EQUAL)
(NOT (EQUAL (CAR W) 'PLUS))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER W (PLUS-FRINGE (CAR D)))
(NUMBERP (EVAL$ T W A))
(NOT (LESSP (EVAL$ T W A)
(EVAL$ T (CAR D) A))))
(EQUAL (EVAL$ T (CONS Z (CONS W D)) A)
T)).
But this further simplifies, rewriting with CAR-NLISTP, and opening up
EQUAL and LISTP, to:
T.
Case 5.1.3.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL Z 'EQUAL)
(NOT (EQUAL (CAR W) 'PLUS))
(EQUAL D 'PLUS)
(MEMBER W (PLUS-FRINGE (CONS D X1)))
(NUMBERP (EVAL$ T W A))
(NOT (LESSP (EVAL$ T W A)
(EVAL$ T (CONS D X1) A))))
(EQUAL (EVAL$ T
(CONS Z (CONS W (CONS (CONS D X1) C)))
A)
T)).
This further simplifies, rewriting with the lemmas CAR-NLISTP,
REWRITE-EVAL$, CAR-CONS, and CDR-CONS, and opening up EQUAL, to:
(IMPLIES (AND (NOT (LISTP W))
(MEMBER W
(PLUS-FRINGE (CONS 'PLUS X1)))
(NUMBERP (EVAL$ T W A))
(NOT (LESSP (EVAL$ T W A)
(PLUS (EVAL$ T (CAR X1) A)
(EVAL$ T (CADR X1) A)))))
(EQUAL (EVAL$ T W A)
(PLUS (EVAL$ T (CAR X1) A)
(EVAL$ T (CADR X1) A)))).
But this again simplifies, using linear arithmetic and applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, PLUS-TREE-PLUS-FRINGE, and
REWRITE-EVAL$, to:
T.
Case 5.1.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'EQUAL)
(NOT (EQUAL V 'PLUS))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER (CONS V C)
(PLUS-FRINGE (CAR D)))
(NUMBERP (EVAL$ T (CONS V C) A))
(NOT (LESSP (EVAL$ T (CONS V C) A)
(EVAL$ T (CAR D) A))))
(EQUAL (EVAL$ T
(CONS Z (CONS (CONS V C) D))
A)
T)).
However this further simplifies, using linear arithmetic and rewriting
with MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, PLUS-TREE-PLUS-FRINGE, and
MEMBER-IMPLIES-NUMBERP, to the following two new goals:
Case 5.1.2.2.
(IMPLIES (AND (NOT (NUMBERP (EVAL$ T (CAR D) A)))
(NOT (LISTP D))
(NOT (EQUAL V 'PLUS))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER (CONS V C)
(PLUS-FRINGE (CAR D)))
(NUMBERP (EVAL$ T (CONS V C) A))
(NOT (LESSP (EVAL$ T (CONS V C) A)
(EVAL$ T (CAR D) A))))
(EQUAL (EVAL$ T
(CONS 'EQUAL (CONS (CONS V C) D))
A)
T)).
This again simplifies, applying CAR-NLISTP, and opening up LISTP, to:
T.
Case 5.1.2.1.
(IMPLIES (AND (NUMBERP (EVAL$ T (CAR D) A))
(EQUAL (EVAL$ T (CONS V C) A)
(EVAL$ T (CAR D) A))
(NOT (LISTP D))
(NOT (EQUAL V 'PLUS))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER (CONS V C)
(PLUS-FRINGE (CAR D)))
(NOT (LESSP (EVAL$ T (CAR D) A)
(EVAL$ T (CAR D) A))))
(EQUAL (EVAL$ T
(CONS 'EQUAL (CONS (CONS V C) D))
A)
T)).
But this again simplifies, rewriting with CAR-NLISTP, and unfolding
the function LISTP, to:
T.
Case 5.1.1.
(IMPLIES (AND (EQUAL Z 'EQUAL)
(NOT (EQUAL V 'PLUS))
(EQUAL D 'PLUS)
(MEMBER (CONS V C)
(PLUS-FRINGE (CONS D Z1)))
(NUMBERP (EVAL$ T (CONS V C) A))
(NOT (LESSP (EVAL$ T (CONS V C) A)
(EVAL$ T (CONS D Z1) A))))
(EQUAL (EVAL$ T
(CONS Z
(CONS (CONS V C)
(CONS (CONS D Z1) X1)))
A)
T)).
This further simplifies, rewriting with the lemmas REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, to:
(IMPLIES (AND (NOT (EQUAL V 'PLUS))
(MEMBER (CONS V C)
(PLUS-FRINGE (CONS 'PLUS Z1)))
(NUMBERP (EVAL$ T (CONS V C) A))
(NOT (LESSP (EVAL$ T (CONS V C) A)
(PLUS (EVAL$ T (CAR Z1) A)
(EVAL$ T (CADR Z1) A)))))
(EQUAL (EVAL$ T (CONS V C) A)
(PLUS (EVAL$ T (CAR Z1) A)
(EVAL$ T (CADR Z1) A)))).
However this again simplifies, using linear arithmetic and applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, PLUS-TREE-PLUS-FRINGE, and
REWRITE-EVAL$, to:
T.
Case 4. (IMPLIES
(AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(NOT (LISTP (CADR X)))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X))))
(EQUAL
(EVAL$ T X A)
(EVAL$ T
(LIST 'IF
(LIST 'NUMBERP (CADR X))
(LIST 'EQUAL
''0
(PLUS-TREE (DELETE (CADR X)
(PLUS-FRINGE (CADDR X)))))
(LIST 'QUOTE F))
A))).
But this again simplifies, applying REWRITE-EVAL$, CAR-CONS, CDR-CONS,
EVAL$-QUOTE, MEMBER-IMPLIES-NUMBERP, PLUS-TREE-PLUS-FRINGE, PLUS-TREE-DELETE,
and EQUAL-DIFFERENCE-0, and unfolding CAR, to the following three new goals:
Case 4.3.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(NOT (LISTP (CADR X)))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X)))
(LESSP (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))
(EQUAL (EVAL$ T X A) F)).
This again simplifies, obviously, to:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(NOT (LISTP (CADR X)))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X)))
(LESSP (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))
(NOT (EVAL$ T X A))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), D
by (CONS V C) to eliminate (CAR D) and (CDR D), and V by (CONS D X1) to
eliminate (CAR V) and (CDR V). We would thus like to prove the following
three new conjectures:
Case 4.3.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'EQUAL)
(NOT (LISTP (CAR V)))
(LISTP (CADR V))
(EQUAL (CAADR V) 'PLUS)
(MEMBER (CAR V)
(PLUS-FRINGE (CADR V)))
(LESSP (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A)))
(NOT (EVAL$ T (CONS Z V) A))).
This further simplifies, applying CAR-NLISTP and CDR-NLISTP, and
expanding the functions LISTP and CAR, to:
T.
Case 4.3.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'EQUAL)
(NOT (LISTP W))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER W (PLUS-FRINGE (CAR D)))
(LESSP (EVAL$ T W A)
(EVAL$ T (CAR D) A)))
(NOT (EVAL$ T (CONS Z (CONS W D)) A))).
This further simplifies, rewriting with CAR-NLISTP, and expanding the
definition of LISTP, to:
T.
Case 4.3.1.
(IMPLIES (AND (EQUAL Z 'EQUAL)
(NOT (LISTP W))
(EQUAL D 'PLUS)
(MEMBER W (PLUS-FRINGE (CONS D X1)))
(LESSP (EVAL$ T W A)
(EVAL$ T (CONS D X1) A)))
(NOT (EVAL$ T
(CONS Z (CONS W (CONS (CONS D X1) C)))
A))).
This further simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, to:
(IMPLIES (AND (NOT (LISTP W))
(MEMBER W
(PLUS-FRINGE (CONS 'PLUS X1)))
(LESSP (EVAL$ T W A)
(PLUS (EVAL$ T (CAR X1) A)
(EVAL$ T (CADR X1) A))))
(NOT (EQUAL (EVAL$ T W A)
(PLUS (EVAL$ T (CAR X1) A)
(EVAL$ T (CADR X1) A))))),
which finally simplifies, using linear arithmetic, to:
T.
Case 4.2.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(NOT (LISTP (CADR X)))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X)))
(NOT (NUMBERP (EVAL$ T (CADR X) A))))
(EQUAL (EVAL$ T X A) F)),
which again simplifies, clearly, to:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(NOT (LISTP (CADR X)))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X)))
(NOT (NUMBERP (EVAL$ T (CADR X) A))))
(NOT (EVAL$ T X A))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), D
by (CONS V C) to eliminate (CAR D) and (CDR D), and V by (CONS D X1) to
eliminate (CAR V) and (CDR V). We thus obtain the following three new
formulas:
Case 4.2.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'EQUAL)
(NOT (LISTP (CAR V)))
(LISTP (CADR V))
(EQUAL (CAADR V) 'PLUS)
(MEMBER (CAR V)
(PLUS-FRINGE (CADR V)))
(NOT (NUMBERP (EVAL$ T (CAR V) A))))
(NOT (EVAL$ T (CONS Z V) A))).
However this further simplifies, applying CAR-NLISTP and CDR-NLISTP, and
unfolding the functions LISTP and CAR, to:
T.
Case 4.2.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'EQUAL)
(NOT (LISTP W))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER W (PLUS-FRINGE (CAR D)))
(NOT (NUMBERP (EVAL$ T W A))))
(NOT (EVAL$ T (CONS Z (CONS W D)) A))).
But this further simplifies, rewriting with CAR-NLISTP, and opening up
the function LISTP, to:
T.
Case 4.2.1.
(IMPLIES (AND (EQUAL Z 'EQUAL)
(NOT (LISTP W))
(EQUAL D 'PLUS)
(MEMBER W (PLUS-FRINGE (CONS D X1)))
(NOT (NUMBERP (EVAL$ T W A))))
(NOT (EVAL$ T
(CONS Z (CONS W (CONS (CONS D X1) C)))
A))).
This further simplifies, appealing to the lemmas REWRITE-EVAL$, CAR-CONS,
and CDR-CONS, to:
T.
Case 4.1.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(NOT (LISTP (CADR X)))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X)))
(NUMBERP (EVAL$ T (CADR X) A))
(NOT (LESSP (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A))))
(EQUAL (EVAL$ T X A) T)).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), D
by (CONS V C) to eliminate (CAR D) and (CDR D), and V by (CONS D X1) to
eliminate (CAR V) and (CDR V). This produces the following three new
formulas:
Case 4.1.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'EQUAL)
(NOT (LISTP (CAR V)))
(LISTP (CADR V))
(EQUAL (CAADR V) 'PLUS)
(MEMBER (CAR V)
(PLUS-FRINGE (CADR V)))
(NUMBERP (EVAL$ T (CAR V) A))
(NOT (LESSP (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A))))
(EQUAL (EVAL$ T (CONS Z V) A) T)).
This further simplifies, applying CAR-NLISTP and CDR-NLISTP, and opening
up the functions LISTP and CAR, to:
T.
Case 4.1.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'EQUAL)
(NOT (LISTP W))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER W (PLUS-FRINGE (CAR D)))
(NUMBERP (EVAL$ T W A))
(NOT (LESSP (EVAL$ T W A)
(EVAL$ T (CAR D) A))))
(EQUAL (EVAL$ T (CONS Z (CONS W D)) A)
T)).
This further simplifies, rewriting with CAR-NLISTP, and expanding the
function LISTP, to:
T.
Case 4.1.1.
(IMPLIES (AND (EQUAL Z 'EQUAL)
(NOT (LISTP W))
(EQUAL D 'PLUS)
(MEMBER W (PLUS-FRINGE (CONS D X1)))
(NUMBERP (EVAL$ T W A))
(NOT (LESSP (EVAL$ T W A)
(EVAL$ T (CONS D X1) A))))
(EQUAL (EVAL$ T
(CONS Z (CONS W (CONS (CONS D X1) C)))
A)
T)).
However this further simplifies, applying REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, to:
(IMPLIES (AND (NOT (LISTP W))
(MEMBER W
(PLUS-FRINGE (CONS 'PLUS X1)))
(NUMBERP (EVAL$ T W A))
(NOT (LESSP (EVAL$ T W A)
(PLUS (EVAL$ T (CAR X1) A)
(EVAL$ T (CADR X1) A)))))
(EQUAL (EVAL$ T W A)
(PLUS (EVAL$ T (CAR X1) A)
(EVAL$ T (CADR X1) A)))),
which again simplifies, using linear arithmetic and applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, PLUS-TREE-PLUS-FRINGE, and
REWRITE-EVAL$, to:
T.
Case 3. (IMPLIES
(AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (EQUAL (CAADDR X) 'PLUS))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X))))
(EQUAL
(EVAL$ T X A)
(EVAL$ T
(LIST 'IF
(LIST 'NUMBERP (CADDR X))
(CONS 'EQUAL
(CONS (PLUS-TREE (DELETE (CADDR X)
(PLUS-FRINGE (CADR X))))
'('0)))
(LIST 'QUOTE F))
A))).
However this again simplifies, applying REWRITE-EVAL$, CAR-CONS, CDR-CONS,
MEMBER-IMPLIES-NUMBERP, PLUS-TREE-PLUS-FRINGE, PLUS-TREE-DELETE, EVAL$-QUOTE,
and EQUAL-DIFFERENCE-0, and expanding CAR, to the following three new
conjectures:
Case 3.3.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (EQUAL (CAADDR X) 'PLUS))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X)))
(LESSP (EVAL$ T (CADDR X) A)
(EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T X A) F)).
This again simplifies, obviously, to:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (EQUAL (CAADDR X) 'PLUS))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X)))
(LESSP (EVAL$ T (CADDR X) A)
(EVAL$ T (CADR X) A)))
(NOT (EVAL$ T X A))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), W
by (CONS V C) to eliminate (CAR W) and (CDR W), D by (CONS W X1) to
eliminate (CAR D) and (CDR D), and W by (CONS D Z1) to eliminate (CAR W)
and (CDR W). This produces the following four new goals:
Case 3.3.4.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'EQUAL)
(LISTP (CAR V))
(EQUAL (CAAR V) 'PLUS)
(NOT (EQUAL (CAADR V) 'PLUS))
(MEMBER (CADR V)
(PLUS-FRINGE (CAR V)))
(LESSP (EVAL$ T (CADR V) A)
(EVAL$ T (CAR V) A)))
(NOT (EVAL$ T (CONS Z V) A))).
However this further simplifies, applying the lemma CAR-NLISTP, and
unfolding the function LISTP, to:
T.
Case 3.3.3.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'EQUAL)
(EQUAL V 'PLUS)
(NOT (EQUAL (CAAR D) 'PLUS))
(MEMBER (CAR D)
(PLUS-FRINGE (CONS V C)))
(LESSP (EVAL$ T (CAR D) A)
(EVAL$ T (CONS V C) A)))
(NOT (EVAL$ T
(CONS Z (CONS (CONS V C) D))
A))),
which further simplifies, applying the lemmas CAR-NLISTP, REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, and unfolding the definitions of CAR and EQUAL,
to the goal:
(IMPLIES (AND (NOT (LISTP D))
(MEMBER 0
(PLUS-FRINGE (CONS 'PLUS C)))
(LESSP (EVAL$ T 0 A)
(PLUS (EVAL$ T (CAR C) A)
(EVAL$ T (CADR C) A))))
(NOT (EQUAL (PLUS (EVAL$ T (CAR C) A)
(EVAL$ T (CADR C) A))
(EVAL$ T 0 A)))).
But this finally simplifies, using linear arithmetic, to:
T.
Case 3.3.2.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL Z 'EQUAL)
(EQUAL V 'PLUS)
(NOT (EQUAL (CAR W) 'PLUS))
(MEMBER W (PLUS-FRINGE (CONS V C)))
(LESSP (EVAL$ T W A)
(EVAL$ T (CONS V C) A)))
(NOT (EVAL$ T
(CONS Z (CONS (CONS V C) (CONS W X1)))
A))),
which further simplifies, applying CAR-NLISTP, REWRITE-EVAL$, CAR-CONS,
and CDR-CONS, and unfolding the function EQUAL, to the new formula:
(IMPLIES (AND (NOT (LISTP W))
(MEMBER W
(PLUS-FRINGE (CONS 'PLUS C)))
(LESSP (EVAL$ T W A)
(PLUS (EVAL$ T (CAR C) A)
(EVAL$ T (CADR C) A))))
(NOT (EQUAL (PLUS (EVAL$ T (CAR C) A)
(EVAL$ T (CADR C) A))
(EVAL$ T W A)))),
which finally simplifies, using linear arithmetic, to:
T.
Case 3.3.1.
(IMPLIES (AND (EQUAL Z 'EQUAL)
(EQUAL V 'PLUS)
(NOT (EQUAL D 'PLUS))
(MEMBER (CONS D Z1)
(PLUS-FRINGE (CONS V C)))
(LESSP (EVAL$ T (CONS D Z1) A)
(EVAL$ T (CONS V C) A)))
(NOT (EVAL$ T
(CONS Z
(CONS (CONS V C)
(CONS (CONS D Z1) X1)))
A))),
which further simplifies, applying REWRITE-EVAL$, CAR-CONS, and CDR-CONS,
to the new conjecture:
(IMPLIES (AND (NOT (EQUAL D 'PLUS))
(MEMBER (CONS D Z1)
(PLUS-FRINGE (CONS 'PLUS C)))
(LESSP (EVAL$ T (CONS D Z1) A)
(PLUS (EVAL$ T (CAR C) A)
(EVAL$ T (CADR C) A))))
(NOT (EQUAL (PLUS (EVAL$ T (CAR C) A)
(EVAL$ T (CADR C) A))
(EVAL$ T (CONS D Z1) A)))),
which finally simplifies, using linear arithmetic, to:
T.
Case 3.2.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (EQUAL (CAADDR X) 'PLUS))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X)))
(NOT (NUMBERP (EVAL$ T (CADDR X) A))))
(EQUAL (EVAL$ T X A) F)),
which again simplifies, clearly, to:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (EQUAL (CAADDR X) 'PLUS))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X)))
(NOT (NUMBERP (EVAL$ T (CADDR X) A))))
(NOT (EVAL$ T X A))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), W
by (CONS V C) to eliminate (CAR W) and (CDR W), D by (CONS W X1) to
eliminate (CAR D) and (CDR D), and W by (CONS D Z1) to eliminate (CAR W)
and (CDR W). We thus obtain the following four new goals:
Case 3.2.4.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'EQUAL)
(LISTP (CAR V))
(EQUAL (CAAR V) 'PLUS)
(NOT (EQUAL (CAADR V) 'PLUS))
(MEMBER (CADR V)
(PLUS-FRINGE (CAR V)))
(NOT (NUMBERP (EVAL$ T (CADR V) A))))
(NOT (EVAL$ T (CONS Z V) A))).
However this further simplifies, applying the lemma CAR-NLISTP, and
opening up LISTP, to:
T.
Case 3.2.3.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'EQUAL)
(EQUAL V 'PLUS)
(NOT (EQUAL (CAAR D) 'PLUS))
(MEMBER (CAR D)
(PLUS-FRINGE (CONS V C)))
(NOT (NUMBERP (EVAL$ T (CAR D) A))))
(NOT (EVAL$ T
(CONS Z (CONS (CONS V C) D))
A))),
which further simplifies, applying the lemmas CAR-NLISTP, REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, and opening up CAR and EQUAL, to:
T.
Case 3.2.2.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL Z 'EQUAL)
(EQUAL V 'PLUS)
(NOT (EQUAL (CAR W) 'PLUS))
(MEMBER W (PLUS-FRINGE (CONS V C)))
(NOT (NUMBERP (EVAL$ T W A))))
(NOT (EVAL$ T
(CONS Z (CONS (CONS V C) (CONS W X1)))
A))),
which further simplifies, rewriting with the lemmas CAR-NLISTP,
REWRITE-EVAL$, CAR-CONS, and CDR-CONS, and expanding the definition of
EQUAL, to:
T.
Case 3.2.1.
(IMPLIES (AND (EQUAL Z 'EQUAL)
(EQUAL V 'PLUS)
(NOT (EQUAL D 'PLUS))
(MEMBER (CONS D Z1)
(PLUS-FRINGE (CONS V C)))
(NOT (NUMBERP (EVAL$ T (CONS D Z1) A))))
(NOT (EVAL$ T
(CONS Z
(CONS (CONS V C)
(CONS (CONS D Z1) X1)))
A))),
which further simplifies, applying REWRITE-EVAL$, CAR-CONS, and CDR-CONS,
to:
T.
Case 3.1.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (EQUAL (CAADDR X) 'PLUS))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X)))
(NUMBERP (EVAL$ T (CADDR X) A))
(NOT (LESSP (EVAL$ T (CADDR X) A)
(EVAL$ T (CADR X) A))))
(EQUAL (EVAL$ T X A) T)).
However this again simplifies, using linear arithmetic and rewriting with
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, PLUS-TREE-PLUS-FRINGE, and
MEMBER-IMPLIES-NUMBERP, to the following two new conjectures:
Case 3.1.2.
(IMPLIES (AND (NOT (NUMBERP (EVAL$ T (CADR X) A)))
(LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (EQUAL (CAADDR X) 'PLUS))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X)))
(NUMBERP (EVAL$ T (CADDR X) A))
(NOT (LESSP (EVAL$ T (CADDR X) A)
(EVAL$ T (CADR X) A))))
(EQUAL (EVAL$ T X A) T)).
However this again simplifies, rewriting with MEMBER-IMPLIES-NUMBERP, to:
T.
Case 3.1.1.
(IMPLIES (AND (NUMBERP (EVAL$ T (CADR X) A))
(EQUAL (EVAL$ T (CADDR X) A)
(EVAL$ T (CADR X) A))
(LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (EQUAL (CAADDR X) 'PLUS))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X)))
(NOT (LESSP (EVAL$ T (CADR X) A)
(EVAL$ T (CADR X) A))))
(EQUAL (EVAL$ T X A) T)).
But this again simplifies, applying the lemmas NUMBERP-EVAL$-PLUS and
MEMBER-IMPLIES-NUMBERP, to:
(IMPLIES (AND (EQUAL (EVAL$ T (CADDR X) A)
(EVAL$ T (CADR X) A))
(LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (EQUAL (CAADDR X) 'PLUS))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X)))
(NOT (LESSP (EVAL$ T (CADR X) A)
(EVAL$ T (CADR X) A))))
(EQUAL (EVAL$ T X A) T)).
Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS V Z) to
eliminate (CDR X) and (CAR X), Z by (CONS D W) to eliminate (CDR Z) and
(CAR Z), W by (CONS Z C) to eliminate (CAR W) and (CDR W), Z by
(CONS W X1) to eliminate (CAR Z) and (CDR Z), D by (CONS Z Z1) to
eliminate (CAR D) and (CDR D), D by (CONS W X1) to eliminate (CAR D) and
(CDR D), and D by (CONS Z C) to eliminate (CAR D) and (CDR D). We must
thus prove four new conjectures:
Case 3.1.1.4.
(IMPLIES (AND (NOT (LISTP Z))
(EQUAL (EVAL$ T (CADR Z) A)
(EVAL$ T (CAR Z) A))
(EQUAL V 'EQUAL)
(LISTP (CAR Z))
(EQUAL (CAAR Z) 'PLUS)
(NOT (EQUAL (CAADR Z) 'PLUS))
(MEMBER (CADR Z)
(PLUS-FRINGE (CAR Z)))
(NOT (LESSP (EVAL$ T (CAR Z) A)
(EVAL$ T (CAR Z) A))))
(EQUAL (EVAL$ T (CONS V Z) A) T)),
which finally simplifies, applying the lemmas CDR-NLISTP and
CAR-NLISTP, and expanding the definitions of CAR and LISTP, to:
T.
Case 3.1.1.3.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL (EVAL$ T (CAR W) A)
(EVAL$ T (CONS Z C) A))
(EQUAL V 'EQUAL)
(EQUAL Z 'PLUS)
(NOT (EQUAL (CAAR W) 'PLUS))
(MEMBER (CAR W)
(PLUS-FRINGE (CONS Z C)))
(NOT (LESSP (EVAL$ T (CONS Z C) A)
(EVAL$ T (CONS Z C) A))))
(EQUAL (EVAL$ T
(CONS V (CONS (CONS Z C) W))
A)
T)),
which finally simplifies, rewriting with CAR-NLISTP, REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, and opening up the definitions of CAR and
EQUAL, to:
T.
Case 3.1.1.2.
(IMPLIES (AND (NOT (LISTP Z))
(EQUAL (EVAL$ T Z A)
(EVAL$ T (CONS W X1) A))
(EQUAL V 'EQUAL)
(EQUAL W 'PLUS)
(NOT (EQUAL (CAR Z) 'PLUS))
(MEMBER Z (PLUS-FRINGE (CONS W X1)))
(NOT (LESSP (EVAL$ T (CONS W X1) A)
(EVAL$ T (CONS W X1) A))))
(EQUAL (EVAL$ T
(CONS V (CONS (CONS W X1) (CONS Z C)))
A)
T)).
But this finally simplifies, appealing to the lemmas REWRITE-EVAL$,
CAR-NLISTP, CAR-CONS, and CDR-CONS, and opening up the definition of
EQUAL, to:
T.
Case 3.1.1.1.
(IMPLIES (AND (EQUAL (EVAL$ T (CONS W X1) A)
(EVAL$ T (CONS Z Z1) A))
(EQUAL V 'EQUAL)
(EQUAL Z 'PLUS)
(NOT (EQUAL W 'PLUS))
(MEMBER (CONS W X1)
(PLUS-FRINGE (CONS Z Z1)))
(NOT (LESSP (EVAL$ T (CONS Z Z1) A)
(EVAL$ T (CONS Z Z1) A))))
(EQUAL (EVAL$ T
(CONS V
(CONS (CONS Z Z1)
(CONS (CONS W X1) C)))
A)
T)),
which finally simplifies, applying REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, and unfolding EQUAL, to:
T.
Case 2. (IMPLIES
(AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (LISTP (CADDR X)))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X))))
(EQUAL
(EVAL$ T X A)
(EVAL$ T
(LIST 'IF
(LIST 'NUMBERP (CADDR X))
(CONS 'EQUAL
(CONS (PLUS-TREE (DELETE (CADDR X)
(PLUS-FRINGE (CADR X))))
'('0)))
(LIST 'QUOTE F))
A))).
However this again simplifies, applying REWRITE-EVAL$, CAR-CONS, CDR-CONS,
MEMBER-IMPLIES-NUMBERP, PLUS-TREE-PLUS-FRINGE, PLUS-TREE-DELETE, EVAL$-QUOTE,
and EQUAL-DIFFERENCE-0, and unfolding the definition of CAR, to the
following three new conjectures:
Case 2.3.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (LISTP (CADDR X)))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X)))
(LESSP (EVAL$ T (CADDR X) A)
(EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T X A) F)).
This again simplifies, trivially, to the new conjecture:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (LISTP (CADDR X)))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X)))
(LESSP (EVAL$ T (CADDR X) A)
(EVAL$ T (CADR X) A)))
(NOT (EVAL$ T X A))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), W
by (CONS V C) to eliminate (CAR W) and (CDR W), and D by (CONS W X1) to
eliminate (CAR D) and (CDR D). We thus obtain the following three new
formulas:
Case 2.3.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'EQUAL)
(LISTP (CAR V))
(EQUAL (CAAR V) 'PLUS)
(NOT (LISTP (CADR V)))
(MEMBER (CADR V)
(PLUS-FRINGE (CAR V)))
(LESSP (EVAL$ T (CADR V) A)
(EVAL$ T (CAR V) A)))
(NOT (EVAL$ T (CONS Z V) A))).
However this further simplifies, applying CAR-NLISTP, and unfolding the
definition of LISTP, to:
T.
Case 2.3.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'EQUAL)
(EQUAL V 'PLUS)
(NOT (LISTP (CAR D)))
(MEMBER (CAR D)
(PLUS-FRINGE (CONS V C)))
(LESSP (EVAL$ T (CAR D) A)
(EVAL$ T (CONS V C) A)))
(NOT (EVAL$ T
(CONS Z (CONS (CONS V C) D))
A))).
This further simplifies, appealing to the lemmas CAR-NLISTP,
REWRITE-EVAL$, CAR-CONS, and CDR-CONS, and expanding LISTP, to:
(IMPLIES (AND (NOT (LISTP D))
(MEMBER 0
(PLUS-FRINGE (CONS 'PLUS C)))
(LESSP (EVAL$ T 0 A)
(PLUS (EVAL$ T (CAR C) A)
(EVAL$ T (CADR C) A))))
(NOT (EQUAL (PLUS (EVAL$ T (CAR C) A)
(EVAL$ T (CADR C) A))
(EVAL$ T 0 A)))).
But this finally simplifies, using linear arithmetic, to:
T.
Case 2.3.1.
(IMPLIES (AND (EQUAL Z 'EQUAL)
(EQUAL V 'PLUS)
(NOT (LISTP W))
(MEMBER W (PLUS-FRINGE (CONS V C)))
(LESSP (EVAL$ T W A)
(EVAL$ T (CONS V C) A)))
(NOT (EVAL$ T
(CONS Z (CONS (CONS V C) (CONS W X1)))
A))),
which further simplifies, applying REWRITE-EVAL$, CAR-CONS, and CDR-CONS,
to:
(IMPLIES (AND (NOT (LISTP W))
(MEMBER W
(PLUS-FRINGE (CONS 'PLUS C)))
(LESSP (EVAL$ T W A)
(PLUS (EVAL$ T (CAR C) A)
(EVAL$ T (CADR C) A))))
(NOT (EQUAL (PLUS (EVAL$ T (CAR C) A)
(EVAL$ T (CADR C) A))
(EVAL$ T W A)))),
which finally simplifies, using linear arithmetic, to:
T.
Case 2.2.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (LISTP (CADDR X)))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X)))
(NOT (NUMBERP (EVAL$ T (CADDR X) A))))
(EQUAL (EVAL$ T X A) F)),
which again simplifies, obviously, to the new formula:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (LISTP (CADDR X)))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X)))
(NOT (NUMBERP (EVAL$ T (CADDR X) A))))
(NOT (EVAL$ T X A))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), W
by (CONS V C) to eliminate (CAR W) and (CDR W), and D by (CONS W X1) to
eliminate (CAR D) and (CDR D). This produces the following three new
goals:
Case 2.2.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'EQUAL)
(LISTP (CAR V))
(EQUAL (CAAR V) 'PLUS)
(NOT (LISTP (CADR V)))
(MEMBER (CADR V)
(PLUS-FRINGE (CAR V)))
(NOT (NUMBERP (EVAL$ T (CADR V) A))))
(NOT (EVAL$ T (CONS Z V) A))).
However this further simplifies, appealing to the lemma CAR-NLISTP, and
unfolding LISTP, to:
T.
Case 2.2.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'EQUAL)
(EQUAL V 'PLUS)
(NOT (LISTP (CAR D)))
(MEMBER (CAR D)
(PLUS-FRINGE (CONS V C)))
(NOT (NUMBERP (EVAL$ T (CAR D) A))))
(NOT (EVAL$ T
(CONS Z (CONS (CONS V C) D))
A))),
which further simplifies, rewriting with CAR-NLISTP, REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, and unfolding the definition of LISTP, to:
T.
Case 2.2.1.
(IMPLIES (AND (EQUAL Z 'EQUAL)
(EQUAL V 'PLUS)
(NOT (LISTP W))
(MEMBER W (PLUS-FRINGE (CONS V C)))
(NOT (NUMBERP (EVAL$ T W A))))
(NOT (EVAL$ T
(CONS Z (CONS (CONS V C) (CONS W X1)))
A))).
However this further simplifies, applying the lemmas REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (LISTP (CADDR X)))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X)))
(NUMBERP (EVAL$ T (CADDR X) A))
(NOT (LESSP (EVAL$ T (CADDR X) A)
(EVAL$ T (CADR X) A))))
(EQUAL (EVAL$ T X A) T)),
which again simplifies, using linear arithmetic and applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, PLUS-TREE-PLUS-FRINGE, and
MEMBER-IMPLIES-NUMBERP, to the following two new goals:
Case 2.1.2.
(IMPLIES (AND (NOT (NUMBERP (EVAL$ T (CADR X) A)))
(LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (LISTP (CADDR X)))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X)))
(NUMBERP (EVAL$ T (CADDR X) A))
(NOT (LESSP (EVAL$ T (CADDR X) A)
(EVAL$ T (CADR X) A))))
(EQUAL (EVAL$ T X A) T)).
But this again simplifies, applying MEMBER-IMPLIES-NUMBERP, to:
T.
Case 2.1.1.
(IMPLIES (AND (NUMBERP (EVAL$ T (CADR X) A))
(EQUAL (EVAL$ T (CADDR X) A)
(EVAL$ T (CADR X) A))
(LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (LISTP (CADDR X)))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X)))
(NOT (LESSP (EVAL$ T (CADR X) A)
(EVAL$ T (CADR X) A))))
(EQUAL (EVAL$ T X A) T)).
However this again simplifies, applying the lemmas NUMBERP-EVAL$-PLUS
and MEMBER-IMPLIES-NUMBERP, to:
(IMPLIES (AND (EQUAL (EVAL$ T (CADDR X) A)
(EVAL$ T (CADR X) A))
(LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (LISTP (CADDR X)))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X)))
(NOT (LESSP (EVAL$ T (CADR X) A)
(EVAL$ T (CADR X) A))))
(EQUAL (EVAL$ T X A) T)).
Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS V Z) to
eliminate (CDR X) and (CAR X), Z by (CONS D W) to eliminate (CDR Z) and
(CAR Z), W by (CONS Z C) to eliminate (CAR W) and (CDR W), D by
(CONS W X1) to eliminate (CAR D) and (CDR D), and D by (CONS Z C) to
eliminate (CAR D) and (CDR D). We must thus prove three new formulas:
Case 2.1.1.3.
(IMPLIES (AND (NOT (LISTP Z))
(EQUAL (EVAL$ T (CADR Z) A)
(EVAL$ T (CAR Z) A))
(EQUAL V 'EQUAL)
(LISTP (CAR Z))
(EQUAL (CAAR Z) 'PLUS)
(NOT (LISTP (CADR Z)))
(MEMBER (CADR Z)
(PLUS-FRINGE (CAR Z)))
(NOT (LESSP (EVAL$ T (CAR Z) A)
(EVAL$ T (CAR Z) A))))
(EQUAL (EVAL$ T (CONS V Z) A) T)),
which finally simplifies, rewriting with CDR-NLISTP and CAR-NLISTP,
and unfolding the definitions of CAR and LISTP, to:
T.
Case 2.1.1.2.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL (EVAL$ T (CAR W) A)
(EVAL$ T (CONS Z C) A))
(EQUAL V 'EQUAL)
(EQUAL Z 'PLUS)
(NOT (LISTP (CAR W)))
(MEMBER (CAR W)
(PLUS-FRINGE (CONS Z C)))
(NOT (LESSP (EVAL$ T (CONS Z C) A)
(EVAL$ T (CONS Z C) A))))
(EQUAL (EVAL$ T
(CONS V (CONS (CONS Z C) W))
A)
T)).
This finally simplifies, applying CAR-NLISTP, REWRITE-EVAL$, CAR-CONS,
and CDR-CONS, and opening up the functions LISTP and EQUAL, to:
T.
Case 2.1.1.1.
(IMPLIES (AND (EQUAL (EVAL$ T Z A)
(EVAL$ T (CONS W X1) A))
(EQUAL V 'EQUAL)
(EQUAL W 'PLUS)
(NOT (LISTP Z))
(MEMBER Z (PLUS-FRINGE (CONS W X1)))
(NOT (LESSP (EVAL$ T (CONS W X1) A)
(EVAL$ T (CONS W X1) A))))
(EQUAL (EVAL$ T
(CONS V (CONS (CONS W X1) (CONS Z C)))
A)
T)).
However this finally simplifies, applying REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, and unfolding EQUAL, to:
T.
Case 1. (IMPLIES
(AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS))
(EQUAL
(EVAL$ T X A)
(EVAL$ T
(LIST 'EQUAL
(PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADR X))
(BAGINT (PLUS-FRINGE (CADR X))
(PLUS-FRINGE (CADDR X)))))
(PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADDR X))
(BAGINT (PLUS-FRINGE (CADR X))
(PLUS-FRINGE (CADDR X))))))
A))).
This again simplifies, applying REWRITE-EVAL$, CAR-CONS, SUBBAGP-BAGINT1,
NUMBERP-EVAL$-PLUS, PLUS-TREE-PLUS-FRINGE, PLUS-TREE-BAGDIFF, CDR-CONS,
SUBBAGP-BAGINT2, BRIDGE-TO-SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP, and
DIFFERENCE-CANCELLATION, to the following two new goals:
Case 1.2.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(NOT (EQUAL (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A))))
(NOT (EVAL$ T X A))).
Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and
(CDR V), W by (CONS V C) to eliminate (CAR W) and (CDR W), D by
(CONS W X1) to eliminate (CAR D) and (CDR D), and W by (CONS D Z1) to
eliminate (CAR W) and (CDR W). The result is three new formulas:
Case 1.2.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'EQUAL)
(LISTP (CAR V))
(EQUAL (CAAR V) 'PLUS)
(LISTP (CADR V))
(EQUAL (CAADR V) 'PLUS)
(NOT (EQUAL (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A))))
(NOT (EVAL$ T (CONS Z V) A))),
which further simplifies, applying CAR-NLISTP, and expanding LISTP, to:
T.
Case 1.2.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'EQUAL)
(EQUAL V 'PLUS)
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(NOT (EQUAL (EVAL$ T (CONS V C) A)
(EVAL$ T (CAR D) A))))
(NOT (EVAL$ T
(CONS Z (CONS (CONS V C) D))
A))).
This further simplifies, rewriting with CAR-NLISTP, and expanding the
function LISTP, to:
T.
Case 1.2.1.
(IMPLIES (AND (EQUAL Z 'EQUAL)
(EQUAL V 'PLUS)
(EQUAL D 'PLUS)
(NOT (EQUAL (EVAL$ T (CONS V C) A)
(EVAL$ T (CONS D Z1) A))))
(NOT (EVAL$ T
(CONS Z
(CONS (CONS V C)
(CONS (CONS D Z1) X1)))
A))).
But this further simplifies, rewriting with the lemmas REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, to:
T.
Case 1.1.
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'EQUAL)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(EQUAL (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))
(EQUAL (EVAL$ T X A) T)).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), W
by (CONS V C) to eliminate (CAR W) and (CDR W), D by (CONS W X1) to
eliminate (CAR D) and (CDR D), and W by (CONS D Z1) to eliminate (CAR W)
and (CDR W). We would thus like to prove the following three new formulas:
Case 1.1.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'EQUAL)
(LISTP (CAR V))
(EQUAL (CAAR V) 'PLUS)
(LISTP (CADR V))
(EQUAL (CAADR V) 'PLUS)
(EQUAL (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A)))
(EQUAL (EVAL$ T (CONS Z V) A) T)).
This further simplifies, applying CAR-NLISTP, and unfolding the
definition of LISTP, to:
T.
Case 1.1.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'EQUAL)
(EQUAL V 'PLUS)
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(EQUAL (EVAL$ T (CONS V C) A)
(EVAL$ T (CAR D) A)))
(EQUAL (EVAL$ T
(CONS Z (CONS (CONS V C) D))
A)
T)).
This further simplifies, applying CAR-NLISTP, and unfolding the
definition of LISTP, to:
T.
Case 1.1.1.
(IMPLIES (AND (EQUAL Z 'EQUAL)
(EQUAL V 'PLUS)
(EQUAL D 'PLUS)
(EQUAL (EVAL$ T (CONS V C) A)
(EVAL$ T (CONS D Z1) A)))
(EQUAL (EVAL$ T
(CONS Z
(CONS (CONS V C)
(CONS (CONS D Z1) X1)))
A)
T)).
But this further simplifies, applying the lemmas REWRITE-EVAL$, CAR-CONS,
and CDR-CONS, and opening up the definition of EQUAL, to:
T.
Q.E.D.
[ 0.0 0.4 0.2 ]
CORRECTNESS-OF-CANCEL-EQUAL-PLUS
(DEFN CANCEL-DIFFERENCE-PLUS
(X)
(IF (AND (LISTP X)
(EQUAL (CAR X) 'DIFFERENCE))
(IF (AND (LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS))
(LIST 'DIFFERENCE
(PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADR X))
(BAGINT (PLUS-FRINGE (CADR X))
(PLUS-FRINGE (CADDR X)))))
(PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADDR X))
(BAGINT (PLUS-FRINGE (CADR X))
(PLUS-FRINGE (CADDR X))))))
(IF (AND (LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X))))
(PLUS-TREE (DELETE (CADDR X)
(PLUS-FRINGE (CADR X))))
(IF (AND (LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X))))
''0
X)))
X))
Observe that:
(OR (LISTP (CANCEL-DIFFERENCE-PLUS X))
(EQUAL (CANCEL-DIFFERENCE-PLUS X) X))
is a theorem.
[ 0.2 0.0 0.0 ]
CANCEL-DIFFERENCE-PLUS
(LEMMA CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS
((META DIFFERENCE))
(EQUAL (EVAL$ T X A)
(EVAL$ T
(CANCEL-DIFFERENCE-PLUS X)
A))
((ENABLE CANCEL-DIFFERENCE-PLUS ASSOCIATIVITY-OF-PLUS
BRIDGE-TO-SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP
COMMUTATIVITY-OF-PLUS DIFF-DIFF-DIFF DIFFERENCE-LESSP-ARG1
DIFFERENCE-PLUS-PLUS-CANCELLATION-HACK EQUAL-DIFFERENCE-0
EVAL$-QUOTE MEMBER-IMPLIES-PLUS-TREE-GREATEREQP
NUMBERP-EVAL$-PLUS PLUS-TREE-BAGDIFF PLUS-TREE-DELETE
PLUS-TREE-PLUS-FRINGE SUBBAGP-BAGINT1 SUBBAGP-BAGINT2)
(DISABLE EVAL$)))
This formula simplifies, opening up the function CANCEL-DIFFERENCE-PLUS, to
the following five new goals:
Case 5. (IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'DIFFERENCE)
(NOT (EQUAL (CAADR X) 'PLUS))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X))))
(EQUAL (EVAL$ T X A)
(EVAL$ T ''0 A))).
However this again simplifies, rewriting with EVAL$-QUOTE, and opening up
CAR, to:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'DIFFERENCE)
(NOT (EQUAL (CAADR X) 'PLUS))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X))))
(EQUAL (EVAL$ T X A) 0)).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), W by
(CONS V C) to eliminate (CAR W) and (CDR W), D by (CONS W X1) to eliminate
(CAR D) and (CDR D), W by (CONS D Z1) to eliminate (CAR W) and (CDR W), D by
(CONS V C) to eliminate (CAR D) and (CDR D), and V by (CONS D X1) to
eliminate (CAR V) and (CDR V). We would thus like to prove the following
five new conjectures:
Case 5.5.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'DIFFERENCE)
(NOT (EQUAL (CAAR V) 'PLUS))
(LISTP (CADR V))
(EQUAL (CAADR V) 'PLUS)
(MEMBER (CAR V)
(PLUS-FRINGE (CADR V))))
(EQUAL (EVAL$ T (CONS Z V) A) 0)).
This further simplifies, rewriting with CAR-NLISTP and CDR-NLISTP, and
opening up the definitions of CAR, EQUAL, and LISTP, to:
T.
Case 5.4.
(IMPLIES (AND (NOT (LISTP D))
(NOT (LISTP W))
(EQUAL Z 'DIFFERENCE)
(NOT (EQUAL (CAR W) 'PLUS))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER W (PLUS-FRINGE (CAR D))))
(EQUAL (EVAL$ T (CONS Z (CONS W D)) A)
0)).
But this further simplifies, applying CAR-NLISTP, and opening up EQUAL and
LISTP, to:
T.
Case 5.3.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL Z 'DIFFERENCE)
(NOT (EQUAL (CAR W) 'PLUS))
(EQUAL D 'PLUS)
(MEMBER W (PLUS-FRINGE (CONS D X1))))
(EQUAL (EVAL$ T
(CONS Z (CONS W (CONS (CONS D X1) C)))
A)
0)).
But this further simplifies, rewriting with the lemmas CAR-NLISTP,
REWRITE-EVAL$, CAR-CONS, CDR-CONS, and EQUAL-DIFFERENCE-0, and opening up
the function EQUAL, to the goal:
(IMPLIES (AND (NOT (LISTP W))
(MEMBER W
(PLUS-FRINGE (CONS 'PLUS X1))))
(NOT (LESSP (PLUS (EVAL$ T (CAR X1) A)
(EVAL$ T (CADR X1) A))
(EVAL$ T W A)))).
But this again simplifies, using linear arithmetic and applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, PLUS-TREE-PLUS-FRINGE, and
REWRITE-EVAL$, to:
T.
Case 5.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'DIFFERENCE)
(NOT (EQUAL V 'PLUS))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER (CONS V C)
(PLUS-FRINGE (CAR D))))
(EQUAL (EVAL$ T
(CONS Z (CONS (CONS V C) D))
A)
0)).
But this further simplifies, applying the lemma CAR-NLISTP, and unfolding
the definition of LISTP, to:
T.
Case 5.1.
(IMPLIES (AND (EQUAL Z 'DIFFERENCE)
(NOT (EQUAL V 'PLUS))
(EQUAL D 'PLUS)
(MEMBER (CONS V C)
(PLUS-FRINGE (CONS D Z1))))
(EQUAL (EVAL$ T
(CONS Z
(CONS (CONS V C)
(CONS (CONS D Z1) X1)))
A)
0)),
which further simplifies, applying REWRITE-EVAL$, CAR-CONS, CDR-CONS, and
EQUAL-DIFFERENCE-0, to the new formula:
(IMPLIES (AND (NOT (EQUAL V 'PLUS))
(MEMBER (CONS V C)
(PLUS-FRINGE (CONS 'PLUS Z1))))
(NOT (LESSP (PLUS (EVAL$ T (CAR Z1) A)
(EVAL$ T (CADR Z1) A))
(EVAL$ T (CONS V C) A)))),
which again simplifies, using linear arithmetic and applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, PLUS-TREE-PLUS-FRINGE, and
REWRITE-EVAL$, to:
T.
Case 4. (IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'DIFFERENCE)
(NOT (LISTP (CADR X)))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X))))
(EQUAL (EVAL$ T X A)
(EVAL$ T ''0 A))).
However this again simplifies, applying the lemma EVAL$-QUOTE, and opening
up the definition of CAR, to:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'DIFFERENCE)
(NOT (LISTP (CADR X)))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X))))
(EQUAL (EVAL$ T X A) 0)).
Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and
(CDR V), D by (CONS V C) to eliminate (CAR D) and (CDR D), and V by
(CONS D X1) to eliminate (CAR V) and (CDR V). The result is three new goals:
Case 4.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'DIFFERENCE)
(NOT (LISTP (CAR V)))
(LISTP (CADR V))
(EQUAL (CAADR V) 'PLUS)
(MEMBER (CAR V)
(PLUS-FRINGE (CADR V))))
(EQUAL (EVAL$ T (CONS Z V) A) 0)),
which further simplifies, rewriting with CAR-NLISTP and CDR-NLISTP, and
unfolding the definitions of LISTP and CAR, to:
T.
Case 4.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'DIFFERENCE)
(NOT (LISTP W))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER W (PLUS-FRINGE (CAR D))))
(EQUAL (EVAL$ T (CONS Z (CONS W D)) A)
0)).
This further simplifies, applying CAR-NLISTP, and unfolding LISTP, to:
T.
Case 4.1.
(IMPLIES (AND (EQUAL Z 'DIFFERENCE)
(NOT (LISTP W))
(EQUAL D 'PLUS)
(MEMBER W (PLUS-FRINGE (CONS D X1))))
(EQUAL (EVAL$ T
(CONS Z (CONS W (CONS (CONS D X1) C)))
A)
0)).
However this further simplifies, rewriting with the lemmas REWRITE-EVAL$,
CAR-CONS, CDR-CONS, and EQUAL-DIFFERENCE-0, to:
(IMPLIES (AND (NOT (LISTP W))
(MEMBER W
(PLUS-FRINGE (CONS 'PLUS X1))))
(NOT (LESSP (PLUS (EVAL$ T (CAR X1) A)
(EVAL$ T (CADR X1) A))
(EVAL$ T W A)))).
This again simplifies, using linear arithmetic and applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, PLUS-TREE-PLUS-FRINGE, and
REWRITE-EVAL$, to:
T.
Case 3. (IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'DIFFERENCE)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (EQUAL (CAADDR X) 'PLUS))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X))))
(EQUAL (EVAL$ T X A)
(EVAL$ T
(PLUS-TREE (DELETE (CADDR X)
(PLUS-FRINGE (CADR X))))
A))).
But this again simplifies, rewriting with NUMBERP-EVAL$-PLUS,
PLUS-TREE-PLUS-FRINGE, and PLUS-TREE-DELETE, to:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'DIFFERENCE)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (EQUAL (CAADDR X) 'PLUS))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X))))
(EQUAL (EVAL$ T X A)
(DIFFERENCE (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), W by
(CONS V C) to eliminate (CAR W) and (CDR W), D by (CONS W X1) to eliminate
(CAR D) and (CDR D), and W by (CONS D Z1) to eliminate (CAR W) and (CDR W).
We thus obtain the following four new formulas:
Case 3.4.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'DIFFERENCE)
(LISTP (CAR V))
(EQUAL (CAAR V) 'PLUS)
(NOT (EQUAL (CAADR V) 'PLUS))
(MEMBER (CADR V)
(PLUS-FRINGE (CAR V))))
(EQUAL (EVAL$ T (CONS Z V) A)
(DIFFERENCE (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A)))).
But this further simplifies, applying CAR-NLISTP, and unfolding LISTP, to:
T.
Case 3.3.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'DIFFERENCE)
(EQUAL V 'PLUS)
(NOT (EQUAL (CAAR D) 'PLUS))
(MEMBER (CAR D)
(PLUS-FRINGE (CONS V C))))
(EQUAL (EVAL$ T
(CONS Z (CONS (CONS V C) D))
A)
(DIFFERENCE (EVAL$ T (CONS V C) A)
(EVAL$ T (CAR D) A)))).
But this further simplifies, rewriting with CAR-NLISTP, REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, and opening up CAR and EQUAL, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL Z 'DIFFERENCE)
(EQUAL V 'PLUS)
(NOT (EQUAL (CAR W) 'PLUS))
(MEMBER W (PLUS-FRINGE (CONS V C))))
(EQUAL (EVAL$ T
(CONS Z (CONS (CONS V C) (CONS W X1)))
A)
(DIFFERENCE (EVAL$ T (CONS V C) A)
(EVAL$ T W A)))).
This further simplifies, rewriting with the lemmas CAR-NLISTP,
REWRITE-EVAL$, CAR-CONS, and CDR-CONS, and opening up EQUAL, to:
T.
Case 3.1.
(IMPLIES (AND (EQUAL Z 'DIFFERENCE)
(EQUAL V 'PLUS)
(NOT (EQUAL D 'PLUS))
(MEMBER (CONS D Z1)
(PLUS-FRINGE (CONS V C))))
(EQUAL (EVAL$ T
(CONS Z
(CONS (CONS V C)
(CONS (CONS D Z1) X1)))
A)
(DIFFERENCE (EVAL$ T (CONS V C) A)
(EVAL$ T (CONS D Z1) A)))),
which further simplifies, rewriting with the lemmas REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, to:
T.
Case 2. (IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'DIFFERENCE)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (LISTP (CADDR X)))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X))))
(EQUAL (EVAL$ T X A)
(EVAL$ T
(PLUS-TREE (DELETE (CADDR X)
(PLUS-FRINGE (CADR X))))
A))),
which again simplifies, rewriting with NUMBERP-EVAL$-PLUS,
PLUS-TREE-PLUS-FRINGE, and PLUS-TREE-DELETE, to the new formula:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'DIFFERENCE)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (LISTP (CADDR X)))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X))))
(EQUAL (EVAL$ T X A)
(DIFFERENCE (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), W by
(CONS V C) to eliminate (CAR W) and (CDR W), and D by (CONS W X1) to
eliminate (CAR D) and (CDR D). We would thus like to prove the following
three new conjectures:
Case 2.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'DIFFERENCE)
(LISTP (CAR V))
(EQUAL (CAAR V) 'PLUS)
(NOT (LISTP (CADR V)))
(MEMBER (CADR V)
(PLUS-FRINGE (CAR V))))
(EQUAL (EVAL$ T (CONS Z V) A)
(DIFFERENCE (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A)))).
However this further simplifies, applying the lemma CAR-NLISTP, and
unfolding LISTP, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'DIFFERENCE)
(EQUAL V 'PLUS)
(NOT (LISTP (CAR D)))
(MEMBER (CAR D)
(PLUS-FRINGE (CONS V C))))
(EQUAL (EVAL$ T
(CONS Z (CONS (CONS V C) D))
A)
(DIFFERENCE (EVAL$ T (CONS V C) A)
(EVAL$ T (CAR D) A)))),
which further simplifies, applying CAR-NLISTP, REWRITE-EVAL$, CAR-CONS,
and CDR-CONS, and expanding the function LISTP, to:
T.
Case 2.1.
(IMPLIES (AND (EQUAL Z 'DIFFERENCE)
(EQUAL V 'PLUS)
(NOT (LISTP W))
(MEMBER W (PLUS-FRINGE (CONS V C))))
(EQUAL (EVAL$ T
(CONS Z (CONS (CONS V C) (CONS W X1)))
A)
(DIFFERENCE (EVAL$ T (CONS V C) A)
(EVAL$ T W A)))).
However this further simplifies, rewriting with REWRITE-EVAL$, CAR-CONS,
and CDR-CONS, to:
T.
Case 1. (IMPLIES
(AND (LISTP X)
(EQUAL (CAR X) 'DIFFERENCE)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS))
(EQUAL
(EVAL$ T X A)
(EVAL$ T
(LIST 'DIFFERENCE
(PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADR X))
(BAGINT (PLUS-FRINGE (CADR X))
(PLUS-FRINGE (CADDR X)))))
(PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADDR X))
(BAGINT (PLUS-FRINGE (CADR X))
(PLUS-FRINGE (CADDR X))))))
A))).
This again simplifies, rewriting with the lemmas REWRITE-EVAL$, CAR-CONS,
SUBBAGP-BAGINT1, NUMBERP-EVAL$-PLUS, PLUS-TREE-PLUS-FRINGE,
PLUS-TREE-BAGDIFF, CDR-CONS, SUBBAGP-BAGINT2,
BRIDGE-TO-SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP, COMMUTATIVITY-OF-PLUS, and
DIFF-DIFF-DIFF, to:
(IMPLIES
(AND (LISTP X)
(EQUAL (CAR X) 'DIFFERENCE)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS))
(EQUAL
(EVAL$ T X A)
(DIFFERENCE (PLUS (EVAL$ T (CADR X) A)
(EVAL$ T
(PLUS-TREE (BAGINT (PLUS-FRINGE (CADR X))
(PLUS-FRINGE (CADDR X))))
A))
(PLUS (EVAL$ T (CADDR X) A)
(EVAL$ T
(PLUS-TREE (BAGINT (PLUS-FRINGE (CADR X))
(PLUS-FRINGE (CADDR X))))
A))))).
Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and
(CDR V), W by (CONS V C) to eliminate (CAR W) and (CDR W), D by (CONS W X1)
to eliminate (CAR D) and (CDR D), and W by (CONS D Z1) to eliminate (CAR W)
and (CDR W). We must thus prove three new conjectures:
Case 1.3.
(IMPLIES
(AND (NOT (LISTP V))
(EQUAL Z 'DIFFERENCE)
(LISTP (CAR V))
(EQUAL (CAAR V) 'PLUS)
(LISTP (CADR V))
(EQUAL (CAADR V) 'PLUS))
(EQUAL
(EVAL$ T (CONS Z V) A)
(DIFFERENCE
(PLUS (EVAL$ T (CAR V) A)
(EVAL$ T
(PLUS-TREE (BAGINT (PLUS-FRINGE (CAR V))
(PLUS-FRINGE (CADR V))))
A))
(PLUS (EVAL$ T (CADR V) A)
(EVAL$ T
(PLUS-TREE (BAGINT (PLUS-FRINGE (CAR V))
(PLUS-FRINGE (CADR V))))
A))))),
which further simplifies, rewriting with CAR-NLISTP, and expanding the
definition of LISTP, to:
T.
Case 1.2.
(IMPLIES
(AND (NOT (LISTP D))
(EQUAL Z 'DIFFERENCE)
(EQUAL V 'PLUS)
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS))
(EQUAL
(EVAL$ T
(CONS Z (CONS (CONS V C) D))
A)
(DIFFERENCE
(PLUS (EVAL$ T (CONS V C) A)
(EVAL$ T
(PLUS-TREE (BAGINT (PLUS-FRINGE (CONS V C))
(PLUS-FRINGE (CAR D))))
A))
(PLUS (EVAL$ T (CAR D) A)
(EVAL$ T
(PLUS-TREE (BAGINT (PLUS-FRINGE (CONS V C))
(PLUS-FRINGE (CAR D))))
A))))).
This further simplifies, applying CAR-NLISTP, and opening up the
definition of LISTP, to:
T.
Case 1.1.
(IMPLIES
(AND (EQUAL Z 'DIFFERENCE)
(EQUAL V 'PLUS)
(EQUAL D 'PLUS))
(EQUAL
(EVAL$ T
(CONS Z
(CONS (CONS V C)
(CONS (CONS D Z1) X1)))
A)
(DIFFERENCE
(PLUS (EVAL$ T (CONS V C) A)
(EVAL$ T
(PLUS-TREE (BAGINT (PLUS-FRINGE (CONS V C))
(PLUS-FRINGE (CONS D Z1))))
A))
(PLUS (EVAL$ T (CONS D Z1) A)
(EVAL$ T
(PLUS-TREE (BAGINT (PLUS-FRINGE (CONS V C))
(PLUS-FRINGE (CONS D Z1))))
A))))).
This further simplifies, rewriting with the lemmas REWRITE-EVAL$, CAR-CONS,
CDR-CONS, ASSOCIATIVITY-OF-PLUS, and
DIFFERENCE-PLUS-PLUS-CANCELLATION-HACK, to:
T.
Q.E.D.
[ 0.0 0.2 0.1 ]
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS
(LEMMA DIFFERENCE-ELIM
(ELIM)
(IMPLIES (AND (NUMBERP Y) (NOT (LESSP Y X)))
(EQUAL (PLUS X (DIFFERENCE Y X)) Y)))
This conjecture simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-ELIM
(LEMMA DIFFERENCE-LEQ-ARG1
(REWRITE)
(IMPLIES (LEQ A B)
(EQUAL (DIFFERENCE A B) 0)))
Name the conjecture *1.
We will try to prove it by induction. Four inductions are suggested by
terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (OR (EQUAL A 0) (NOT (NUMBERP A)))
(p A B))
(IMPLIES (AND (NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(OR (EQUAL B 0) (NOT (NUMBERP B))))
(p A B))
(IMPLIES (AND (NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(p (SUB1 A) (SUB1 B)))
(p A B))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT establish that the measure (COUNT B) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for A. The above induction scheme
generates four new conjectures:
Case 4. (IMPLIES (AND (OR (EQUAL A 0) (NOT (NUMBERP A)))
(NOT (LESSP B A)))
(EQUAL (DIFFERENCE A B) 0)),
which simplifies, opening up NOT, OR, EQUAL, LESSP, and DIFFERENCE, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(OR (EQUAL B 0) (NOT (NUMBERP B)))
(NOT (LESSP B A)))
(EQUAL (DIFFERENCE A B) 0)),
which simplifies, unfolding NOT, OR, EQUAL, and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(LESSP (SUB1 B) (SUB1 A))
(NOT (LESSP B A)))
(EQUAL (DIFFERENCE A B) 0)),
which simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP A 1)
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(LESSP (SUB1 B) (SUB1 A))
(NOT (LESSP B A)))
(EQUAL (DIFFERENCE A B) 0)).
This again simplifies, expanding SUB1, NUMBERP, EQUAL, LESSP, NOT, and OR,
to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(EQUAL (DIFFERENCE (SUB1 A) (SUB1 B))
0)
(NOT (LESSP B A)))
(EQUAL (DIFFERENCE A B) 0)),
which simplifies, using linear arithmetic, to three new conjectures:
Case 1.3.
(IMPLIES (AND (LESSP A B)
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(EQUAL (DIFFERENCE (SUB1 A) (SUB1 B))
0)
(NOT (LESSP B A)))
(EQUAL (DIFFERENCE A B) 0)),
which again simplifies, using linear arithmetic, to two new formulas:
Case 1.3.2.
(IMPLIES (AND (LESSP (SUB1 A) (SUB1 B))
(LESSP A B)
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(EQUAL (DIFFERENCE (SUB1 A) (SUB1 B))
0)
(NOT (LESSP B A)))
(EQUAL (DIFFERENCE A B) 0)),
which again simplifies, expanding the functions LESSP, NOT, OR,
DIFFERENCE, and EQUAL, to:
T.
Case 1.3.1.
(IMPLIES (AND (LESSP A 1)
(LESSP A B)
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(EQUAL (DIFFERENCE (SUB1 A) (SUB1 B))
0)
(NOT (LESSP B A)))
(EQUAL (DIFFERENCE A B) 0)),
which again simplifies, opening up the definitions of SUB1, NUMBERP,
EQUAL, LESSP, NOT, and OR, to:
T.
Case 1.2.
(IMPLIES (AND (LESSP (SUB1 A) (SUB1 B))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(EQUAL (DIFFERENCE (SUB1 A) (SUB1 B))
0)
(NOT (LESSP B A)))
(EQUAL (DIFFERENCE A B) 0)),
which again simplifies, opening up the definitions of NOT, OR, LESSP,
DIFFERENCE, and EQUAL, to:
T.
Case 1.1.
(IMPLIES (AND (LESSP A 1)
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(EQUAL (DIFFERENCE (SUB1 A) (SUB1 B))
0)
(NOT (LESSP B A)))
(EQUAL (DIFFERENCE A B) 0)),
which again simplifies, unfolding the functions SUB1, NUMBERP, EQUAL,
LESSP, NOT, and OR, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-LEQ-ARG1
(LEMMA DIFFERENCE-ADD1-ARG2
(REWRITE)
(EQUAL (DIFFERENCE A (ADD1 B))
(IF (LESSP B A)
(SUB1 (DIFFERENCE A B))
0))
((ENABLE DIFFERENCE-LEQ-ARG1)
(INDUCT (DIFFERENCE A B))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, OR, and
AND, to three new formulas:
Case 3. (IMPLIES (ZEROP A)
(EQUAL (DIFFERENCE A (ADD1 B))
(IF (LESSP B A)
(SUB1 (DIFFERENCE A B))
0))),
which simplifies, using linear arithmetic, applying DIFFERENCE-LEQ-ARG1, and
opening up the definitions of ZEROP, EQUAL, and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(ZEROP B))
(EQUAL (DIFFERENCE A (ADD1 B))
(IF (LESSP B A)
(SUB1 (DIFFERENCE A B))
0))).
This simplifies, applying SUB1-TYPE-RESTRICTION, and unfolding the
definitions of ZEROP, ADD1, EQUAL, LESSP, and DIFFERENCE, to two new
formulas:
Case 2.2.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL B 0))
(EQUAL (DIFFERENCE A 1) (SUB1 A))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP B)))
(EQUAL (DIFFERENCE A 1) (SUB1 A))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(EQUAL (DIFFERENCE (SUB1 A) (ADD1 (SUB1 B)))
(IF (LESSP (SUB1 B) (SUB1 A))
(SUB1 (DIFFERENCE (SUB1 A) (SUB1 B)))
0)))
(EQUAL (DIFFERENCE A (ADD1 B))
(IF (LESSP B A)
(SUB1 (DIFFERENCE A B))
0))),
which simplifies, applying ADD1-SUB1 and SUB1-ADD1, and unfolding DIFFERENCE,
LESSP, and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-ADD1-ARG2
(LEMMA DIFFERENCE-SUB1-ARG2
(REWRITE)
(EQUAL (DIFFERENCE A (SUB1 B))
(IF (ZEROP B)
(FIX A)
(IF (LESSP A B)
0
(ADD1 (DIFFERENCE A B)))))
((ENABLE DIFF-SUB1-ARG2)))
This conjecture simplifies, rewriting with the lemma DIFF-SUB1-ARG2, and
unfolding the functions ZEROP and FIX, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-SUB1-ARG2
(LEMMA DIFFERENCE-DIFFERENCE-ARG1
(REWRITE)
(EQUAL (DIFFERENCE (DIFFERENCE X Y) Z)
(DIFFERENCE X (PLUS Y Z)))
((ENABLE DIFF-DIFF-ARG1)))
WARNING: the previously added lemma, DIFF-DIFF-ARG1, could be applied
whenever the newly proposed DIFFERENCE-DIFFERENCE-ARG1 could!
This formula can be simplified, using the abbreviation DIFF-DIFF-ARG1, to:
(EQUAL (DIFFERENCE X (PLUS Y Z))
(DIFFERENCE X (PLUS Y Z))),
which simplifies, trivially, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-DIFFERENCE-ARG1
(LEMMA DIFFERENCE-DIFFERENCE-ARG2
(REWRITE)
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
(IF (LESSP B C)
(FIX A)
(DIFFERENCE (PLUS A C) B)))
((ENABLE DIFF-DIFF-ARG2)))
WARNING: the previously added lemma, DIFF-DIFF-ARG2, could be applied
whenever the newly proposed DIFFERENCE-DIFFERENCE-ARG2 could!
This simplifies, appealing to the lemma DIFF-DIFF-ARG2, and opening up the
function FIX, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-DIFFERENCE-ARG2
(LEMMA DIFFERENCE-X-X
(REWRITE)
(EQUAL (DIFFERENCE X X) 0))
This conjecture simplifies, using linear arithmetic, to:
(IMPLIES (LESSP X X)
(EQUAL (DIFFERENCE X X) 0)).
But this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-X-X
(LEMMA LESSP-DIFFERENCE-CANCELLATION
(REWRITE)
(EQUAL (LESSP (DIFFERENCE A C)
(DIFFERENCE B C))
(IF (LEQ C A)
(LESSP A B)
(LESSP C B)))
((ENABLE EQUAL-DIFFERENCE-0)))
This conjecture simplifies, clearly, to two new conjectures:
Case 2. (IMPLIES (NOT (LESSP A C))
(EQUAL (LESSP (DIFFERENCE A C)
(DIFFERENCE B C))
(LESSP A B))),
which we will name *1.
Case 1. (IMPLIES (LESSP A C)
(EQUAL (LESSP (DIFFERENCE A C)
(DIFFERENCE B C))
(LESSP C B))),
which we would usually push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us consider:
(EQUAL (LESSP (DIFFERENCE A C)
(DIFFERENCE B C))
(IF (IF (LESSP A C) F T)
(LESSP A B)
(LESSP C B))),
which we named *1 above. We will appeal to induction. Ten inductions are
suggested by terms in the conjecture. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP A) (p A C B))
(IMPLIES (AND (NOT (ZEROP A)) (ZEROP C))
(p A C B))
(IMPLIES (AND (NOT (ZEROP A))
(NOT (ZEROP C))
(p (SUB1 A) (SUB1 C) (SUB1 B)))
(p A C B))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to prove that the measure (COUNT A) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instances chosen for B and C. The above induction
scheme leads to three new conjectures:
Case 3. (IMPLIES (ZEROP A)
(EQUAL (LESSP (DIFFERENCE A C)
(DIFFERENCE B C))
(IF (IF (LESSP A C) F T)
(LESSP A B)
(LESSP C B)))),
which simplifies, expanding the definitions of ZEROP, EQUAL, DIFFERENCE, and
LESSP, to 12 new goals:
Case 3.12.
(IMPLIES (AND (EQUAL A 0)
(NOT (NUMBERP C))
(NOT (EQUAL B 0))
(NOT (NUMBERP B)))
(EQUAL F (NUMBERP B))),
which again simplifies, clearly, to:
T.
Case 3.11.
(IMPLIES (AND (EQUAL A 0)
(EQUAL C 0)
(NOT (EQUAL B 0))
(NOT (NUMBERP B)))
(EQUAL F (NUMBERP B))).
This again simplifies, clearly, to:
T.
Case 3.10.
(IMPLIES (AND (EQUAL A 0)
(NOT (NUMBERP C))
(NOT (EQUAL B 0))
(NUMBERP B))
(EQUAL T (NUMBERP B))).
This again simplifies, obviously, to:
T.
Case 3.9.
(IMPLIES (AND (EQUAL A 0)
(EQUAL C 0)
(NOT (EQUAL B 0))
(NUMBERP B))
(EQUAL T (NUMBERP B))).
This again simplifies, trivially, to:
T.
Case 3.8.
(IMPLIES (AND (EQUAL A 0)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL (DIFFERENCE (SUB1 B) (SUB1 C))
0)))
(EQUAL T (LESSP (SUB1 C) (SUB1 B)))).
This again simplifies, applying EQUAL-DIFFERENCE-0, to:
T.
Case 3.7.
(IMPLIES (AND (EQUAL A 0)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (EQUAL B 0))
(NUMBERP B)
(EQUAL (DIFFERENCE (SUB1 B) (SUB1 C))
0))
(EQUAL F (LESSP (SUB1 C) (SUB1 B)))).
This again simplifies, rewriting with EQUAL-DIFFERENCE-0, to:
T.
Case 3.6.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (NUMBERP C))
(NOT (EQUAL B 0))
(NOT (NUMBERP B)))
(EQUAL F (NUMBERP B))).
This again simplifies, obviously, to:
T.
Case 3.5.
(IMPLIES (AND (NOT (NUMBERP A))
(EQUAL C 0)
(NOT (EQUAL B 0))
(NOT (NUMBERP B)))
(EQUAL F (NUMBERP B))).
This again simplifies, obviously, to:
T.
Case 3.4.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (NUMBERP C))
(NOT (EQUAL B 0))
(NUMBERP B))
(EQUAL T (NUMBERP B))).
This again simplifies, clearly, to:
T.
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP A))
(EQUAL C 0)
(NOT (EQUAL B 0))
(NUMBERP B))
(EQUAL T (NUMBERP B))).
This again simplifies, obviously, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL (DIFFERENCE (SUB1 B) (SUB1 C))
0)))
(EQUAL T (LESSP (SUB1 C) (SUB1 B)))).
But this again simplifies, appealing to the lemma EQUAL-DIFFERENCE-0, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (EQUAL B 0))
(NUMBERP B)
(EQUAL (DIFFERENCE (SUB1 B) (SUB1 C))
0))
(EQUAL F (LESSP (SUB1 C) (SUB1 B)))),
which again simplifies, applying EQUAL-DIFFERENCE-0, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP A)) (ZEROP C))
(EQUAL (LESSP (DIFFERENCE A C)
(DIFFERENCE B C))
(IF (IF (LESSP A C) F T)
(LESSP A B)
(LESSP C B)))).
This simplifies, unfolding the functions ZEROP, EQUAL, DIFFERENCE, and LESSP,
to the following six new conjectures:
Case 2.6.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL C 0)
(NOT (EQUAL B 0))
(NUMBERP B))
(EQUAL (LESSP A B)
(LESSP (SUB1 A) (SUB1 B)))).
However this again simplifies, unfolding LESSP, to:
T.
Case 2.5.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL C 0)
(EQUAL B 0))
(EQUAL (LESSP A 0) F)),
which again simplifies, opening up the functions EQUAL and LESSP, to:
T.
Case 2.4.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL C 0)
(NOT (NUMBERP B)))
(EQUAL (LESSP A 0) F)),
which again simplifies, opening up the definitions of EQUAL and LESSP, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP C))
(NOT (EQUAL B 0))
(NUMBERP B))
(EQUAL (LESSP A B)
(LESSP (SUB1 A) (SUB1 B)))),
which again simplifies, opening up the definition of LESSP, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP C))
(EQUAL B 0))
(EQUAL (LESSP A 0) F)),
which again simplifies, unfolding the definitions of EQUAL and LESSP, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP C))
(NOT (NUMBERP B)))
(EQUAL (LESSP A 0) F)),
which again simplifies, unfolding the definitions of EQUAL and LESSP, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP A))
(NOT (ZEROP C))
(EQUAL (LESSP (DIFFERENCE (SUB1 A) (SUB1 C))
(DIFFERENCE (SUB1 B) (SUB1 C)))
(IF (IF (LESSP (SUB1 A) (SUB1 C)) F T)
(LESSP (SUB1 A) (SUB1 B))
(LESSP (SUB1 C) (SUB1 B)))))
(EQUAL (LESSP (DIFFERENCE A C)
(DIFFERENCE B C))
(IF (IF (LESSP A C) F T)
(LESSP A B)
(LESSP C B)))),
which simplifies, opening up the definitions of ZEROP, DIFFERENCE, and LESSP,
to four new conjectures:
Case 1.4.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (SUB1 A) (SUB1 C)))
(EQUAL (LESSP (DIFFERENCE (SUB1 A) (SUB1 C))
(DIFFERENCE (SUB1 B) (SUB1 C)))
(LESSP (SUB1 A) (SUB1 B)))
(NOT (NUMBERP B)))
(EQUAL (LESSP (DIFFERENCE (SUB1 A) (SUB1 C))
0)
F)),
which again simplifies, expanding the functions EQUAL and LESSP, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (SUB1 A) (SUB1 C)))
(EQUAL (LESSP (DIFFERENCE (SUB1 A) (SUB1 C))
(DIFFERENCE (SUB1 B) (SUB1 C)))
(LESSP (SUB1 A) (SUB1 B)))
(EQUAL B 0))
(EQUAL (LESSP (DIFFERENCE (SUB1 A) (SUB1 C))
0)
F)),
which again simplifies, unfolding the functions SUB1, EQUAL, DIFFERENCE,
and LESSP, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL C 0))
(NUMBERP C)
(LESSP (SUB1 A) (SUB1 C))
(EQUAL (LESSP (DIFFERENCE (SUB1 A) (SUB1 C))
(DIFFERENCE (SUB1 B) (SUB1 C)))
(LESSP (SUB1 C) (SUB1 B)))
(NOT (NUMBERP B)))
(EQUAL (LESSP (DIFFERENCE (SUB1 A) (SUB1 C))
0)
F)),
which again simplifies, unfolding the functions EQUAL and LESSP, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL C 0))
(NUMBERP C)
(LESSP (SUB1 A) (SUB1 C))
(EQUAL (LESSP (DIFFERENCE (SUB1 A) (SUB1 C))
(DIFFERENCE (SUB1 B) (SUB1 C)))
(LESSP (SUB1 C) (SUB1 B)))
(EQUAL B 0))
(EQUAL (LESSP (DIFFERENCE (SUB1 A) (SUB1 C))
0)
F)),
which again simplifies, unfolding the functions SUB1, EQUAL, DIFFERENCE,
and LESSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.1 ]
LESSP-DIFFERENCE-CANCELLATION
(DISABLE LESSP-DIFFERENCE-CANCELLATION)
[ 0.0 0.0 0.0 ]
LESSP-DIFFERENCE-CANCELLATION-OFF
(DEFN CANCEL-LESSP-PLUS
(X)
(IF (AND (LISTP X)
(EQUAL (CAR X) 'LESSP))
(IF (AND (LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS))
(LIST 'LESSP
(PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADR X))
(BAGINT (PLUS-FRINGE (CADR X))
(PLUS-FRINGE (CADDR X)))))
(PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADDR X))
(BAGINT (PLUS-FRINGE (CADR X))
(PLUS-FRINGE (CADDR X))))))
(IF (AND (LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X))))
(LIST 'QUOTE F)
(IF (AND (LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X))))
(LIST 'NOT
(LIST 'ZEROP
(PLUS-TREE (DELETE (CADR X)
(PLUS-FRINGE (CADDR X))))))
X)))
X))
Note that:
(OR (LISTP (CANCEL-LESSP-PLUS X))
(EQUAL (CANCEL-LESSP-PLUS X) X))
is a theorem.
[ 0.0 0.0 0.0 ]
CANCEL-LESSP-PLUS
(LEMMA CORRECTNESS-OF-CANCEL-LESSP-PLUS
((META LESSP))
(EQUAL (EVAL$ T X A)
(EVAL$ T (CANCEL-LESSP-PLUS X) A))
((ENABLE CANCEL-LESSP-PLUS
BRIDGE-TO-SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP
EQUAL-DIFFERENCE-0 EVAL$-QUOTE LESSP-DIFFERENCE-CANCELLATION
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP NUMBERP-EVAL$-PLUS
PLUS-TREE-BAGDIFF PLUS-TREE-DELETE PLUS-TREE-PLUS-FRINGE
SUBBAGP-BAGINT1 SUBBAGP-BAGINT2)
(DISABLE EVAL$)))
This formula simplifies, opening up the function CANCEL-LESSP-PLUS, to the
following five new goals:
Case 5. (IMPLIES
(AND (LISTP X)
(EQUAL (CAR X) 'LESSP)
(NOT (EQUAL (CAADR X) 'PLUS))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X))))
(EQUAL
(EVAL$ T X A)
(EVAL$ T
(LIST 'NOT
(LIST 'ZEROP
(PLUS-TREE (DELETE (CADR X)
(PLUS-FRINGE (CADDR X))))))
A))).
However this again simplifies, rewriting with REWRITE-EVAL$, CAR-CONS,
NUMBERP-EVAL$-PLUS, PLUS-TREE-PLUS-FRINGE, PLUS-TREE-DELETE, and
EQUAL-DIFFERENCE-0, and opening up ZEROP and NOT, to:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'LESSP)
(NOT (EQUAL (CAADR X) 'PLUS))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X))))
(EQUAL (EVAL$ T X A)
(LESSP (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), W by
(CONS V C) to eliminate (CAR W) and (CDR W), D by (CONS W X1) to eliminate
(CAR D) and (CDR D), W by (CONS D Z1) to eliminate (CAR W) and (CDR W), D by
(CONS V C) to eliminate (CAR D) and (CDR D), and V by (CONS D X1) to
eliminate (CAR V) and (CDR V). We would thus like to prove the following
five new conjectures:
Case 5.5.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'LESSP)
(NOT (EQUAL (CAAR V) 'PLUS))
(LISTP (CADR V))
(EQUAL (CAADR V) 'PLUS)
(MEMBER (CAR V)
(PLUS-FRINGE (CADR V))))
(EQUAL (EVAL$ T (CONS Z V) A)
(LESSP (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A)))).
This further simplifies, rewriting with CAR-NLISTP and CDR-NLISTP, and
opening up the definitions of CAR, EQUAL, and LISTP, to:
T.
Case 5.4.
(IMPLIES (AND (NOT (LISTP D))
(NOT (LISTP W))
(EQUAL Z 'LESSP)
(NOT (EQUAL (CAR W) 'PLUS))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER W (PLUS-FRINGE (CAR D))))
(EQUAL (EVAL$ T (CONS Z (CONS W D)) A)
(LESSP (EVAL$ T W A)
(EVAL$ T (CAR D) A)))).
But this further simplifies, applying CAR-NLISTP, and opening up EQUAL and
LISTP, to:
T.
Case 5.3.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL Z 'LESSP)
(NOT (EQUAL (CAR W) 'PLUS))
(EQUAL D 'PLUS)
(MEMBER W (PLUS-FRINGE (CONS D X1))))
(EQUAL (EVAL$ T
(CONS Z (CONS W (CONS (CONS D X1) C)))
A)
(LESSP (EVAL$ T W A)
(EVAL$ T (CONS D X1) A)))).
But this further simplifies, rewriting with the lemmas CAR-NLISTP,
REWRITE-EVAL$, CAR-CONS, and CDR-CONS, and opening up the function EQUAL,
to:
T.
Case 5.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'LESSP)
(NOT (EQUAL V 'PLUS))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER (CONS V C)
(PLUS-FRINGE (CAR D))))
(EQUAL (EVAL$ T
(CONS Z (CONS (CONS V C) D))
A)
(LESSP (EVAL$ T (CONS V C) A)
(EVAL$ T (CAR D) A)))),
which further simplifies, rewriting with the lemma CAR-NLISTP, and opening
up the function LISTP, to:
T.
Case 5.1.
(IMPLIES (AND (EQUAL Z 'LESSP)
(NOT (EQUAL V 'PLUS))
(EQUAL D 'PLUS)
(MEMBER (CONS V C)
(PLUS-FRINGE (CONS D Z1))))
(EQUAL (EVAL$ T
(CONS Z
(CONS (CONS V C)
(CONS (CONS D Z1) X1)))
A)
(LESSP (EVAL$ T (CONS V C) A)
(EVAL$ T (CONS D Z1) A)))),
which further simplifies, rewriting with the lemmas REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, to:
T.
Case 4. (IMPLIES
(AND (LISTP X)
(EQUAL (CAR X) 'LESSP)
(NOT (LISTP (CADR X)))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X))))
(EQUAL
(EVAL$ T X A)
(EVAL$ T
(LIST 'NOT
(LIST 'ZEROP
(PLUS-TREE (DELETE (CADR X)
(PLUS-FRINGE (CADDR X))))))
A))),
which again simplifies, rewriting with REWRITE-EVAL$, CAR-CONS,
NUMBERP-EVAL$-PLUS, PLUS-TREE-PLUS-FRINGE, PLUS-TREE-DELETE, and
EQUAL-DIFFERENCE-0, and expanding the functions ZEROP and NOT, to:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'LESSP)
(NOT (LISTP (CADR X)))
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS)
(MEMBER (CADR X)
(PLUS-FRINGE (CADDR X))))
(EQUAL (EVAL$ T X A)
(LESSP (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), D by
(CONS V C) to eliminate (CAR D) and (CDR D), and V by (CONS D X1) to
eliminate (CAR V) and (CDR V). We would thus like to prove the following
three new formulas:
Case 4.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'LESSP)
(NOT (LISTP (CAR V)))
(LISTP (CADR V))
(EQUAL (CAADR V) 'PLUS)
(MEMBER (CAR V)
(PLUS-FRINGE (CADR V))))
(EQUAL (EVAL$ T (CONS Z V) A)
(LESSP (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A)))).
This further simplifies, rewriting with CAR-NLISTP and CDR-NLISTP, and
expanding the functions LISTP and CAR, to:
T.
Case 4.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'LESSP)
(NOT (LISTP W))
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS)
(MEMBER W (PLUS-FRINGE (CAR D))))
(EQUAL (EVAL$ T (CONS Z (CONS W D)) A)
(LESSP (EVAL$ T W A)
(EVAL$ T (CAR D) A)))).
But this further simplifies, applying CAR-NLISTP, and opening up the
function LISTP, to:
T.
Case 4.1.
(IMPLIES (AND (EQUAL Z 'LESSP)
(NOT (LISTP W))
(EQUAL D 'PLUS)
(MEMBER W (PLUS-FRINGE (CONS D X1))))
(EQUAL (EVAL$ T
(CONS Z (CONS W (CONS (CONS D X1) C)))
A)
(LESSP (EVAL$ T W A)
(EVAL$ T (CONS D X1) A)))).
This further simplifies, appealing to the lemmas REWRITE-EVAL$, CAR-CONS,
and CDR-CONS, to:
T.
Case 3. (IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'LESSP)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (EQUAL (CAADDR X) 'PLUS))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X))))
(EQUAL (EVAL$ T X A)
(EVAL$ T (LIST 'QUOTE F) A))),
which again simplifies, applying EVAL$-QUOTE, and expanding the definition
of CAR, to:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'LESSP)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (EQUAL (CAADDR X) 'PLUS))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X))))
(NOT (EVAL$ T X A))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), W by
(CONS V C) to eliminate (CAR W) and (CDR W), D by (CONS W X1) to eliminate
(CAR D) and (CDR D), and W by (CONS D Z1) to eliminate (CAR W) and (CDR W).
This produces the following four new formulas:
Case 3.4.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'LESSP)
(LISTP (CAR V))
(EQUAL (CAAR V) 'PLUS)
(NOT (EQUAL (CAADR V) 'PLUS))
(MEMBER (CADR V)
(PLUS-FRINGE (CAR V))))
(NOT (EVAL$ T (CONS Z V) A))).
But this further simplifies, applying CAR-NLISTP, and opening up the
definition of LISTP, to:
T.
Case 3.3.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'LESSP)
(EQUAL V 'PLUS)
(NOT (EQUAL (CAAR D) 'PLUS))
(MEMBER (CAR D)
(PLUS-FRINGE (CONS V C))))
(NOT (EVAL$ T
(CONS Z (CONS (CONS V C) D))
A))).
This further simplifies, applying the lemmas CAR-NLISTP, REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, and unfolding the definitions of CAR and EQUAL, to:
(IMPLIES (AND (NOT (LISTP D))
(MEMBER 0
(PLUS-FRINGE (CONS 'PLUS C))))
(NOT (LESSP (PLUS (EVAL$ T (CAR C) A)
(EVAL$ T (CADR C) A))
(EVAL$ T 0 A)))).
But this again simplifies, using linear arithmetic and rewriting with
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, PLUS-TREE-PLUS-FRINGE, and
REWRITE-EVAL$, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL Z 'LESSP)
(EQUAL V 'PLUS)
(NOT (EQUAL (CAR W) 'PLUS))
(MEMBER W (PLUS-FRINGE (CONS V C))))
(NOT (EVAL$ T
(CONS Z (CONS (CONS V C) (CONS W X1)))
A))).
But this further simplifies, applying CAR-NLISTP, REWRITE-EVAL$, CAR-CONS,
and CDR-CONS, and unfolding EQUAL, to:
(IMPLIES (AND (NOT (LISTP W))
(MEMBER W
(PLUS-FRINGE (CONS 'PLUS C))))
(NOT (LESSP (PLUS (EVAL$ T (CAR C) A)
(EVAL$ T (CADR C) A))
(EVAL$ T W A)))),
which again simplifies, using linear arithmetic and rewriting with
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, PLUS-TREE-PLUS-FRINGE, and
REWRITE-EVAL$, to:
T.
Case 3.1.
(IMPLIES (AND (EQUAL Z 'LESSP)
(EQUAL V 'PLUS)
(NOT (EQUAL D 'PLUS))
(MEMBER (CONS D Z1)
(PLUS-FRINGE (CONS V C))))
(NOT (EVAL$ T
(CONS Z
(CONS (CONS V C)
(CONS (CONS D Z1) X1)))
A))).
However this further simplifies, applying REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, to:
(IMPLIES (AND (NOT (EQUAL D 'PLUS))
(MEMBER (CONS D Z1)
(PLUS-FRINGE (CONS 'PLUS C))))
(NOT (LESSP (PLUS (EVAL$ T (CAR C) A)
(EVAL$ T (CADR C) A))
(EVAL$ T (CONS D Z1) A)))),
which again simplifies, using linear arithmetic and rewriting with the
lemmas MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, PLUS-TREE-PLUS-FRINGE, and
REWRITE-EVAL$, to:
T.
Case 2. (IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'LESSP)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (LISTP (CADDR X)))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X))))
(EQUAL (EVAL$ T X A)
(EVAL$ T (LIST 'QUOTE F) A))),
which again simplifies, rewriting with the lemma EVAL$-QUOTE, and expanding
CAR, to:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'LESSP)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(NOT (LISTP (CADDR X)))
(MEMBER (CADDR X)
(PLUS-FRINGE (CADR X))))
(NOT (EVAL$ T X A))).
Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and
(CDR V), W by (CONS V C) to eliminate (CAR W) and (CDR W), and D by
(CONS W X1) to eliminate (CAR D) and (CDR D). We must thus prove three new
goals:
Case 2.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'LESSP)
(LISTP (CAR V))
(EQUAL (CAAR V) 'PLUS)
(NOT (LISTP (CADR V)))
(MEMBER (CADR V)
(PLUS-FRINGE (CAR V))))
(NOT (EVAL$ T (CONS Z V) A))),
which further simplifies, applying CAR-NLISTP, and opening up LISTP, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'LESSP)
(EQUAL V 'PLUS)
(NOT (LISTP (CAR D)))
(MEMBER (CAR D)
(PLUS-FRINGE (CONS V C))))
(NOT (EVAL$ T
(CONS Z (CONS (CONS V C) D))
A))).
But this further simplifies, rewriting with CAR-NLISTP, REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, and unfolding the function LISTP, to:
(IMPLIES (AND (NOT (LISTP D))
(MEMBER 0
(PLUS-FRINGE (CONS 'PLUS C))))
(NOT (LESSP (PLUS (EVAL$ T (CAR C) A)
(EVAL$ T (CADR C) A))
(EVAL$ T 0 A)))),
which again simplifies, using linear arithmetic and rewriting with the
lemmas MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, PLUS-TREE-PLUS-FRINGE, and
REWRITE-EVAL$, to:
T.
Case 2.1.
(IMPLIES (AND (EQUAL Z 'LESSP)
(EQUAL V 'PLUS)
(NOT (LISTP W))
(MEMBER W (PLUS-FRINGE (CONS V C))))
(NOT (EVAL$ T
(CONS Z (CONS (CONS V C) (CONS W X1)))
A))),
which further simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, to the new conjecture:
(IMPLIES (AND (NOT (LISTP W))
(MEMBER W
(PLUS-FRINGE (CONS 'PLUS C))))
(NOT (LESSP (PLUS (EVAL$ T (CAR C) A)
(EVAL$ T (CADR C) A))
(EVAL$ T W A)))),
which again simplifies, using linear arithmetic and applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, PLUS-TREE-PLUS-FRINGE, and
REWRITE-EVAL$, to:
T.
Case 1. (IMPLIES
(AND (LISTP X)
(EQUAL (CAR X) 'LESSP)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS))
(EQUAL
(EVAL$ T X A)
(EVAL$ T
(LIST 'LESSP
(PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADR X))
(BAGINT (PLUS-FRINGE (CADR X))
(PLUS-FRINGE (CADDR X)))))
(PLUS-TREE (BAGDIFF (PLUS-FRINGE (CADDR X))
(BAGINT (PLUS-FRINGE (CADR X))
(PLUS-FRINGE (CADDR X))))))
A))).
However this again simplifies, applying the lemmas REWRITE-EVAL$, CAR-CONS,
SUBBAGP-BAGINT1, NUMBERP-EVAL$-PLUS, PLUS-TREE-PLUS-FRINGE,
PLUS-TREE-BAGDIFF, CDR-CONS, SUBBAGP-BAGINT2,
BRIDGE-TO-SUBBAGP-IMPLIES-PLUS-TREE-GREATEREQP, and
LESSP-DIFFERENCE-CANCELLATION, to the formula:
(IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'LESSP)
(LISTP (CADR X))
(EQUAL (CAADR X) 'PLUS)
(LISTP (CADDR X))
(EQUAL (CAADDR X) 'PLUS))
(EQUAL (EVAL$ T X A)
(LESSP (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))).
Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and
(CDR V), W by (CONS V C) to eliminate (CAR W) and (CDR W), D by (CONS W X1)
to eliminate (CAR D) and (CDR D), and W by (CONS D Z1) to eliminate (CAR W)
and (CDR W). This generates three new goals:
Case 1.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'LESSP)
(LISTP (CAR V))
(EQUAL (CAAR V) 'PLUS)
(LISTP (CADR V))
(EQUAL (CAADR V) 'PLUS))
(EQUAL (EVAL$ T (CONS Z V) A)
(LESSP (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A)))),
which further simplifies, applying CAR-NLISTP, and expanding the
definition of LISTP, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'LESSP)
(EQUAL V 'PLUS)
(LISTP (CAR D))
(EQUAL (CAAR D) 'PLUS))
(EQUAL (EVAL$ T
(CONS Z (CONS (CONS V C) D))
A)
(LESSP (EVAL$ T (CONS V C) A)
(EVAL$ T (CAR D) A)))).
But this further simplifies, applying CAR-NLISTP, and unfolding LISTP, to:
T.
Case 1.1.
(IMPLIES (AND (EQUAL Z 'LESSP)
(EQUAL V 'PLUS)
(EQUAL D 'PLUS))
(EQUAL (EVAL$ T
(CONS Z
(CONS (CONS V C)
(CONS (CONS D Z1) X1)))
A)
(LESSP (EVAL$ T (CONS V C) A)
(EVAL$ T (CONS D Z1) A)))).
This further simplifies, applying REWRITE-EVAL$, CAR-CONS, and CDR-CONS,
to:
T.
Q.E.D.
[ 0.0 0.1 0.1 ]
CORRECTNESS-OF-CANCEL-LESSP-PLUS
(DEFTHEORY ADDITION
(EQUAL-PLUS-0 EQUAL-DIFFERENCE-0 COMMUTATIVITY-OF-PLUS
COMMUTATIVITY2-OF-PLUS PLUS-ZERO-ARG2 PLUS-ADD1-ARG2
PLUS-ADD1-ARG1 ASSOCIATIVITY-OF-PLUS
PLUS-DIFFERENCE-ARG1 PLUS-DIFFERENCE-ARG2
DIFF-DIFF-ARG1 DIFF-DIFF-ARG2
CORRECTNESS-OF-CANCEL-EQUAL-PLUS
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS DIFFERENCE-ELIM
DIFFERENCE-LEQ-ARG1 DIFFERENCE-ADD1-ARG2
DIFFERENCE-SUB1-ARG2 DIFFERENCE-DIFFERENCE-ARG1
DIFFERENCE-DIFFERENCE-ARG2 DIFFERENCE-X-X
CORRECTNESS-OF-CANCEL-LESSP-PLUS))
[ 0.0 0.0 0.0 ]
ADDITION
(LEMMA EQUAL-TIMES-0
(REWRITE)
(EQUAL (EQUAL (TIMES X Y) 0)
(OR (ZEROP X) (ZEROP Y)))
((ENABLE EQUAL-PLUS-0)
(INDUCT (TIMES X Y))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, OR, and
AND, to two new goals:
Case 2. (IMPLIES (ZEROP X)
(EQUAL (EQUAL (TIMES X Y) 0)
(OR (ZEROP X) (ZEROP Y)))),
which simplifies, opening up the definitions of ZEROP, EQUAL, TIMES, and OR,
to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (EQUAL (TIMES (SUB1 X) Y) 0)
(OR (ZEROP (SUB1 X)) (ZEROP Y))))
(EQUAL (EQUAL (TIMES X Y) 0)
(OR (ZEROP X) (ZEROP Y)))),
which simplifies, rewriting with EQUAL-PLUS-0, and expanding the functions
ZEROP, OR, TIMES, EQUAL, PLUS, and NUMBERP, to the new formula:
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (TIMES (SUB1 X) Y) 0)
(EQUAL Y 0))
(EQUAL (TIMES (SUB1 X) 0) 0)),
which again simplifies, trivially, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-TIMES-0
(LEMMA EQUAL-TIMES-1
(REWRITE)
(EQUAL (EQUAL (TIMES A B) 1)
(AND (EQUAL A 1) (EQUAL B 1)))
((ENABLE EQUAL-PLUS-0)
(INDUCT (TIMES A B))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, OR, and
AND, to two new conjectures:
Case 2. (IMPLIES (ZEROP A)
(EQUAL (EQUAL (TIMES A B) 1)
(AND (EQUAL A 1) (EQUAL B 1)))),
which simplifies, expanding the definitions of ZEROP, EQUAL, TIMES, and AND,
to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (EQUAL (TIMES (SUB1 A) B) 1)
(AND (EQUAL (SUB1 A) 1) (EQUAL B 1))))
(EQUAL (EQUAL (TIMES A B) 1)
(AND (EQUAL A 1) (EQUAL B 1)))),
which simplifies, expanding AND, TIMES, SUB1, NUMBERP, and EQUAL, to six new
goals:
Case 1.6.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL (TIMES (SUB1 A) B) 1))
(NOT (EQUAL (SUB1 A) 1))
(EQUAL (PLUS B (TIMES (SUB1 A) B)) 1))
(EQUAL (EQUAL B 1) T)),
which again simplifies, obviously, to:
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL (TIMES (SUB1 A) B) 1))
(NOT (EQUAL (SUB1 A) 1))
(EQUAL (PLUS B (TIMES (SUB1 A) B)) 1))
(EQUAL B 1)),
which again simplifies, using linear arithmetic, to the goal:
(IMPLIES (AND (NOT (NUMBERP B))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL (TIMES (SUB1 A) B) 1))
(NOT (EQUAL (SUB1 A) 1))
(EQUAL (PLUS B (TIMES (SUB1 A) B)) 1))
(EQUAL B 1)).
But this again simplifies, opening up PLUS, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL (TIMES (SUB1 A) B) 1))
(NOT (EQUAL (SUB1 A) 1))
(NOT (EQUAL (PLUS B (TIMES (SUB1 A) B)) 1))
(EQUAL A 1))
(NOT (EQUAL B 1))),
which again simplifies, unfolding EQUAL, NUMBERP, SUB1, TIMES, and PLUS,
to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL (TIMES (SUB1 A) B) 1))
(NOT (EQUAL (SUB1 A) 1))
(EQUAL (PLUS B (TIMES (SUB1 A) B)) 1))
(EQUAL A 1)).
Applying the lemma SUB1-ELIM, replace A by (ADD1 X) to eliminate (SUB1 A).
We employ the type restriction lemma noted when SUB1 was introduced to
restrict the new variable. We would thus like to prove the new conjecture:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (ADD1 X) 0))
(NOT (EQUAL (TIMES X B) 1))
(NOT (EQUAL X 1))
(EQUAL (PLUS B (TIMES X B)) 1))
(EQUAL (ADD1 X) 1)),
which further simplifies, appealing to the lemma ADD1-EQUAL, and opening
up NUMBERP, to:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (TIMES X B) 1))
(NOT (EQUAL X 1))
(EQUAL (PLUS B (TIMES X B)) 1))
(EQUAL X 0)).
Name the above subgoal *1.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL (TIMES (SUB1 A) B) 1))
(NOT (EQUAL B 1)))
(NOT (EQUAL (PLUS B (TIMES (SUB1 A) B))
1))).
However this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (NUMBERP B))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL (TIMES (SUB1 A) B) 1))
(NOT (EQUAL B 1)))
(NOT (EQUAL (PLUS B (TIMES (SUB1 A) B))
1))).
But this again simplifies, opening up the definition of PLUS, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (TIMES (SUB1 A) B) 1)
(EQUAL (SUB1 A) 1)
(EQUAL (EQUAL B 1) T)
(NOT (EQUAL A 1)))
(NOT (EQUAL (PLUS B B 0) 1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (TIMES (SUB1 A) B) 1)
(EQUAL (SUB1 A) 1)
(EQUAL (EQUAL B 1) T)
(EQUAL A 1))
(EQUAL (EQUAL (PLUS B B 0) 1) T)),
which again simplifies, using linear arithmetic, to:
T.
So next consider:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (TIMES X B) 1))
(NOT (EQUAL X 1))
(EQUAL (PLUS B (TIMES X B)) 1))
(EQUAL X 0)),
which we named *1 above. We will try to prove it by induction. The recursive
terms in the conjecture suggest three inductions. They merge into two likely
candidate inductions. However, only one is unflawed. We will induct
according to the following scheme:
(AND (IMPLIES (ZEROP X) (p X B))
(IMPLIES (AND (NOT (ZEROP X)) (p (SUB1 X) B))
(p X B))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT X) decreases according to the well-founded relation
LESSP in each induction step of the scheme. The above induction scheme leads
to five new conjectures:
Case 5. (IMPLIES (AND (ZEROP X)
(NUMBERP X)
(NOT (EQUAL (TIMES X B) 1))
(NOT (EQUAL X 1))
(EQUAL (PLUS B (TIMES X B)) 1))
(EQUAL X 0)),
which simplifies, expanding ZEROP, to:
T.
Case 4. (IMPLIES (AND (NOT (ZEROP X))
(EQUAL (TIMES (SUB1 X) B) 1)
(NUMBERP X)
(NOT (EQUAL (TIMES X B) 1))
(NOT (EQUAL X 1))
(EQUAL (PLUS B (TIMES X B)) 1))
(EQUAL X 0)),
which simplifies, unfolding ZEROP and TIMES, to:
(IMPLIES (AND (EQUAL (TIMES (SUB1 X) B) 1)
(NUMBERP X)
(NOT (EQUAL (PLUS B 1) 1))
(NOT (EQUAL X 1))
(EQUAL (PLUS B B 1) 1))
(EQUAL X 0)).
But this again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (NOT (ZEROP X))
(EQUAL (SUB1 X) 1)
(NUMBERP X)
(NOT (EQUAL (TIMES X B) 1))
(NOT (EQUAL X 1))
(EQUAL (PLUS B (TIMES X B)) 1))
(EQUAL X 0)),
which simplifies, unfolding ZEROP and TIMES, to:
(IMPLIES (AND (EQUAL (SUB1 X) 1)
(NUMBERP X)
(NOT (EQUAL (PLUS B (TIMES (SUB1 X) B)) 1))
(NOT (EQUAL X 1))
(EQUAL (PLUS B B (TIMES (SUB1 X) B))
1))
(EQUAL X 0)).
However this again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP X))
(NOT (EQUAL (PLUS B (TIMES (SUB1 X) B)) 1))
(NUMBERP X)
(NOT (EQUAL (TIMES X B) 1))
(NOT (EQUAL X 1))
(EQUAL (PLUS B (TIMES X B)) 1))
(EQUAL X 0)),
which simplifies, unfolding the definitions of ZEROP and TIMES, to:
(IMPLIES (AND (NOT (EQUAL (PLUS B (TIMES (SUB1 X) B)) 1))
(NUMBERP X)
(NOT (EQUAL X 1))
(EQUAL (PLUS B B (TIMES (SUB1 X) B))
1))
(EQUAL X 0)).
However this again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(EQUAL (SUB1 X) 0)
(NUMBERP X)
(NOT (EQUAL (TIMES X B) 1))
(NOT (EQUAL X 1))
(EQUAL (PLUS B (TIMES X B)) 1))
(EQUAL X 0)),
which simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
EQUAL-TIMES-1
(LEMMA EQUAL-SUB1-0
(REWRITE)
(EQUAL (EQUAL (SUB1 X) 0)
(OR (ZEROP X) (EQUAL X 1))))
This formula simplifies, expanding ZEROP and OR, to four new conjectures:
Case 4. (IMPLIES (NOT (EQUAL (SUB1 X) 0))
(NOT (EQUAL X 0))),
which again simplifies, expanding the definitions of SUB1 and EQUAL, to:
T.
Case 3. (IMPLIES (NOT (EQUAL (SUB1 X) 0))
(NUMBERP X)),
which again simplifies, applying the lemma SUB1-NNUMBERP, and opening up
EQUAL, to:
T.
Case 2. (IMPLIES (NOT (EQUAL (SUB1 X) 0))
(NOT (EQUAL X 1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (EQUAL (SUB1 X) 0)
(NOT (EQUAL X 0))
(NUMBERP X))
(EQUAL (EQUAL X 1) T)),
which again simplifies, obviously, to the new goal:
(IMPLIES (AND (EQUAL (SUB1 X) 0)
(NOT (EQUAL X 0))
(NUMBERP X))
(EQUAL X 1)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-SUB1-0
(LEMMA TIMES-ZERO
(REWRITE)
(IMPLIES (ZEROP Y)
(EQUAL (TIMES X Y) 0))
((ENABLE PLUS-ZERO-ARG2 COMMUTATIVITY-OF-PLUS)))
This conjecture simplifies, expanding ZEROP, to the following two new goals:
Case 2. (IMPLIES (EQUAL Y 0)
(EQUAL (TIMES X 0) 0)).
This again simplifies, clearly, to:
(EQUAL (TIMES X 0) 0),
which we will name *1.
Case 1. (IMPLIES (NOT (NUMBERP Y))
(EQUAL (TIMES X Y) 0)),
which we would usually push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us consider:
(IMPLIES (ZEROP Y)
(EQUAL (TIMES X Y) 0)).
We gave this the name *1 above. Perhaps we can prove it by induction. There
is only one plausible induction. We will induct according to the following
scheme:
(AND (IMPLIES (ZEROP X) (p X Y))
(IMPLIES (AND (NOT (ZEROP X)) (p (SUB1 X) Y))
(p X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT X) decreases according to the well-founded relation
LESSP in each induction step of the scheme. The above induction scheme
produces the following two new goals:
Case 2. (IMPLIES (AND (ZEROP X) (ZEROP Y))
(EQUAL (TIMES X Y) 0)).
This simplifies, expanding the functions ZEROP, TIMES, and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(EQUAL (TIMES (SUB1 X) Y) 0)
(ZEROP Y))
(EQUAL (TIMES X Y) 0)).
This simplifies, rewriting with the lemma PLUS-ZERO-ARG2, and opening up
ZEROP, PLUS, EQUAL, and TIMES, to:
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (TIMES (SUB1 X) Y) 0)
(EQUAL Y 0))
(EQUAL (TIMES (SUB1 X) 0) 0)),
which again simplifies, clearly, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-ZERO
(LEMMA TIMES-ADD1
(REWRITE)
(EQUAL (TIMES X (ADD1 Y))
(IF (NUMBERP Y)
(PLUS X (TIMES X Y))
(FIX X)))
((ENABLE PLUS-ZERO-ARG2 COMMUTATIVITY-OF-PLUS)))
This conjecture simplifies, unfolding the definition of FIX, to three new
conjectures:
Case 3. (IMPLIES (AND (NOT (NUMBERP Y)) (NUMBERP X))
(EQUAL (TIMES X (ADD1 Y)) X)),
which again simplifies, rewriting with SUB1-TYPE-RESTRICTION, to the new
formula:
(IMPLIES (AND (NOT (NUMBERP Y)) (NUMBERP X))
(EQUAL (TIMES X 1) X)),
which we will name *1.
Case 2. (IMPLIES (AND (NOT (NUMBERP Y))
(NOT (NUMBERP X)))
(EQUAL (TIMES X (ADD1 Y)) 0)).
However this again simplifies, applying SUB1-TYPE-RESTRICTION, and opening
up the definitions of TIMES and EQUAL, to:
T.
Case 1. (IMPLIES (NUMBERP Y)
(EQUAL (TIMES X (ADD1 Y))
(PLUS X (TIMES X Y)))),
which we would usually push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us consider:
(EQUAL (TIMES X (ADD1 Y))
(IF (NUMBERP Y)
(PLUS X (TIMES X Y))
(FIX X))),
which we named *1 above. We will appeal to induction. The recursive terms in
the conjecture suggest three inductions. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP X) (p X Y))
(IMPLIES (AND (NOT (ZEROP X)) (p (SUB1 X) Y))
(p X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT X) decreases according to the well-founded
relation LESSP in each induction step of the scheme. The above induction
scheme leads to the following two new formulas:
Case 2. (IMPLIES (ZEROP X)
(EQUAL (TIMES X (ADD1 Y))
(IF (NUMBERP Y)
(PLUS X (TIMES X Y))
(FIX X)))).
This simplifies, rewriting with PLUS-ZERO-ARG2, and expanding the
definitions of ZEROP, EQUAL, TIMES, PLUS, and FIX, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(EQUAL (TIMES (SUB1 X) (ADD1 Y))
(IF (NUMBERP Y)
(PLUS (SUB1 X) (TIMES (SUB1 X) Y))
(FIX (SUB1 X)))))
(EQUAL (TIMES X (ADD1 Y))
(IF (NUMBERP Y)
(PLUS X (TIMES X Y))
(FIX X)))),
which simplifies, applying SUB1-TYPE-RESTRICTION and SUB1-ADD1, and
unfolding the functions ZEROP, FIX, TIMES, and PLUS, to the following two
new formulas:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (NUMBERP Y))
(EQUAL (TIMES (SUB1 X) (ADD1 Y))
(SUB1 X)))
(EQUAL (TIMES X 1) X)).
But this further simplifies, rewriting with SUB1-TYPE-RESTRICTION, and
unfolding TIMES, to the new formula:
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (NUMBERP Y))
(EQUAL (TIMES (SUB1 X) 1) (SUB1 X)))
(EQUAL (PLUS 1 (SUB1 X)) X)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NUMBERP Y)
(EQUAL (TIMES (SUB1 X) (ADD1 Y))
(PLUS (SUB1 X) (TIMES (SUB1 X) Y))))
(EQUAL (ADD1 (PLUS Y (TIMES (SUB1 X) (ADD1 Y))))
(PLUS X Y (TIMES (SUB1 X) Y)))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.1 ]
TIMES-ADD1
(LEMMA COMMUTATIVITY-OF-TIMES
(REWRITE)
(EQUAL (TIMES Y X) (TIMES X Y))
((ENABLE TIMES-ZERO TIMES-ADD1)))
WARNING: the newly proposed lemma, COMMUTATIVITY-OF-TIMES, could be applied
whenever the previously added lemma TIMES-ADD1 could.
WARNING: the newly proposed lemma, COMMUTATIVITY-OF-TIMES, could be applied
whenever the previously added lemma TIMES-ZERO could.
Give the conjecture the name *1.
We will appeal to induction. Two inductions are suggested by terms in
the conjecture, both of which are flawed. We limit our consideration to the
two suggested by the largest number of nonprimitive recursive functions in the
conjecture. Since both of these are equally likely, we will choose
arbitrarily. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP Y) (p Y X))
(IMPLIES (AND (NOT (ZEROP Y)) (p (SUB1 Y) X))
(p Y X))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT Y) decreases according to the well-founded relation
LESSP in each induction step of the scheme. The above induction scheme
produces the following two new conjectures:
Case 2. (IMPLIES (ZEROP Y)
(EQUAL (TIMES Y X) (TIMES X Y))).
This simplifies, applying TIMES-ZERO, and opening up the functions ZEROP,
EQUAL, and TIMES, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP Y))
(EQUAL (TIMES (SUB1 Y) X)
(TIMES X (SUB1 Y))))
(EQUAL (TIMES Y X) (TIMES X Y))),
which simplifies, unfolding the functions ZEROP and TIMES, to:
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(EQUAL (TIMES (SUB1 Y) X)
(TIMES X (SUB1 Y))))
(EQUAL (PLUS X (TIMES X (SUB1 Y)))
(TIMES X Y))).
Appealing to the lemma SUB1-ELIM, we now replace Y by (ADD1 Z) to eliminate
(SUB1 Y). We employ the type restriction lemma noted when SUB1 was
introduced to constrain the new variable. We must thus prove:
(IMPLIES (AND (NUMBERP Z)
(NOT (EQUAL (ADD1 Z) 0))
(EQUAL (TIMES Z X) (TIMES X Z)))
(EQUAL (PLUS X (TIMES X Z))
(TIMES X (ADD1 Z)))).
However this further simplifies, applying the lemma TIMES-ADD1, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
COMMUTATIVITY-OF-TIMES
(LEMMA TIMES-DISTRIBUTES-OVER-PLUS-PROOF NIL
(EQUAL (TIMES X (PLUS Y Z))
(PLUS (TIMES X Y) (TIMES X Z)))
((ENABLE COMMUTATIVITY2-OF-PLUS ASSOCIATIVITY-OF-PLUS)))
Call the conjecture *1.
We will try to prove it by induction. There are four plausible
inductions. They merge into two likely candidate inductions. However, only
one is unflawed. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP X) (p X Y Z))
(IMPLIES (AND (NOT (ZEROP X)) (p (SUB1 X) Y Z))
(p X Y Z))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT X) decreases according to the well-founded relation
LESSP in each induction step of the scheme. The above induction scheme
generates two new goals:
Case 2. (IMPLIES (ZEROP X)
(EQUAL (TIMES X (PLUS Y Z))
(PLUS (TIMES X Y) (TIMES X Z)))),
which simplifies, opening up the functions ZEROP, EQUAL, TIMES, and PLUS, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(EQUAL (TIMES (SUB1 X) (PLUS Y Z))
(PLUS (TIMES (SUB1 X) Y)
(TIMES (SUB1 X) Z))))
(EQUAL (TIMES X (PLUS Y Z))
(PLUS (TIMES X Y) (TIMES X Z)))),
which simplifies, applying ASSOCIATIVITY-OF-PLUS and COMMUTATIVITY2-OF-PLUS,
and unfolding the functions ZEROP and TIMES, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-DISTRIBUTES-OVER-PLUS-PROOF
(LEMMA TIMES-DISTRIBUTES-OVER-PLUS
(REWRITE)
(AND (EQUAL (TIMES X (PLUS Y Z))
(PLUS (TIMES X Y) (TIMES X Z)))
(EQUAL (TIMES (PLUS X Y) Z)
(PLUS (TIMES X Z) (TIMES Y Z))))
((USE (TIMES-DISTRIBUTES-OVER-PLUS-PROOF (X X)
(Y Y)
(Z Z))
(TIMES-DISTRIBUTES-OVER-PLUS-PROOF (X Z)
(Y X)
(Z Y)))
(ENABLE COMMUTATIVITY-OF-TIMES)))
WARNING: the previously added lemma, COMMUTATIVITY-OF-TIMES, could be applied
whenever the newly proposed TIMES-DISTRIBUTES-OVER-PLUS could!
WARNING: the previously added lemma, COMMUTATIVITY-OF-TIMES, could be applied
whenever the newly proposed TIMES-DISTRIBUTES-OVER-PLUS could!
WARNING: Note that the proposed lemma TIMES-DISTRIBUTES-OVER-PLUS is to be
stored as zero type prescription rules, zero compound recognizer rules, zero
linear rules, and two replacement rules.
This formula simplifies, applying COMMUTATIVITY-OF-TIMES, and opening up the
definition of AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-DISTRIBUTES-OVER-PLUS
(LEMMA COMMUTATIVITY2-OF-TIMES
(REWRITE)
(EQUAL (TIMES X Y Z) (TIMES Y X Z))
((ENABLE COMMUTATIVITY-OF-TIMES TIMES-DISTRIBUTES-OVER-PLUS)))
WARNING: the previously added lemma, COMMUTATIVITY-OF-TIMES, could be applied
whenever the newly proposed COMMUTATIVITY2-OF-TIMES could!
Call the conjecture *1.
Perhaps we can prove it by induction. Four inductions are suggested by
terms in the conjecture. They merge into two likely candidate inductions,
both of which are unflawed. Since both of these are equally likely, we will
choose arbitrarily. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP Y) (p X Y Z))
(IMPLIES (AND (NOT (ZEROP Y)) (p X (SUB1 Y) Z))
(p X Y Z))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to prove that the measure (COUNT Y) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme leads to two new goals:
Case 2. (IMPLIES (ZEROP Y)
(EQUAL (TIMES X Y Z) (TIMES Y X Z))),
which simplifies, applying the lemma COMMUTATIVITY-OF-TIMES, and opening up
the definitions of ZEROP, EQUAL, and TIMES, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP Y))
(EQUAL (TIMES X (SUB1 Y) Z)
(TIMES (SUB1 Y) X Z)))
(EQUAL (TIMES X Y Z) (TIMES Y X Z))),
which simplifies, rewriting with TIMES-DISTRIBUTES-OVER-PLUS, and opening up
the functions ZEROP and TIMES, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
COMMUTATIVITY2-OF-TIMES
(LEMMA ASSOCIATIVITY-OF-TIMES
(REWRITE)
(EQUAL (TIMES (TIMES X Y) Z)
(TIMES X Y Z))
((ENABLE COMMUTATIVITY-OF-TIMES COMMUTATIVITY2-OF-TIMES)))
WARNING: the previously added lemma, COMMUTATIVITY-OF-TIMES, could be applied
whenever the newly proposed ASSOCIATIVITY-OF-TIMES could!
This simplifies, rewriting with COMMUTATIVITY-OF-TIMES and
COMMUTATIVITY2-OF-TIMES, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ASSOCIATIVITY-OF-TIMES
(LEMMA TIMES-DISTRIBUTES-OVER-DIFFERENCE-PROOF NIL
(EQUAL (TIMES (DIFFERENCE A B) C)
(DIFFERENCE (TIMES A C) (TIMES B C)))
((ENABLE COMMUTATIVITY-OF-TIMES)
(ENABLE-THEORY ADDITION)))
This simplifies, appealing to the lemma COMMUTATIVITY-OF-TIMES, to the
conjecture:
(EQUAL (TIMES C (DIFFERENCE A B))
(DIFFERENCE (TIMES A C) (TIMES B C))).
Appealing to the lemma DIFFERENCE-ELIM, we now replace A by (PLUS B X) to
eliminate (DIFFERENCE A B). We employ the type restriction lemma noted when
DIFFERENCE was introduced to constrain the new variable. This generates three
new formulas:
Case 3. (IMPLIES (LESSP A B)
(EQUAL (TIMES C (DIFFERENCE A B))
(DIFFERENCE (TIMES A C)
(TIMES B C)))),
which further simplifies, using linear arithmetic, rewriting with the lemmas
DIFFERENCE-LEQ-ARG1, COMMUTATIVITY-OF-TIMES, and EQUAL-DIFFERENCE-0, and
expanding the functions EQUAL and TIMES, to the goal:
(IMPLIES (LESSP A B)
(NOT (LESSP (TIMES B C) (TIMES A C)))),
which we would usually push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us consider:
(EQUAL (TIMES (DIFFERENCE A B) C)
(DIFFERENCE (TIMES A C) (TIMES B C))),
which we named *1 above. We will appeal to induction. The recursive terms in
the conjecture suggest four inductions. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP A) (p A B C))
(IMPLIES (AND (NOT (ZEROP A)) (ZEROP B))
(p A B C))
(IMPLIES (AND (NOT (ZEROP A))
(NOT (ZEROP B))
(p (SUB1 A) (SUB1 B) C))
(p A B C))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT A) decreases according to the well-founded relation
LESSP in each induction step of the scheme. Note, however, the inductive
instance chosen for B. The above induction scheme produces the following
three new goals:
Case 3. (IMPLIES (ZEROP A)
(EQUAL (TIMES (DIFFERENCE A B) C)
(DIFFERENCE (TIMES A C)
(TIMES B C)))).
This simplifies, using linear arithmetic, appealing to the lemma
DIFFERENCE-LEQ-ARG1, and expanding the functions ZEROP, EQUAL, and TIMES, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP A)) (ZEROP B))
(EQUAL (TIMES (DIFFERENCE A B) C)
(DIFFERENCE (TIMES A C)
(TIMES B C)))).
This simplifies, appealing to the lemma EQUAL-PLUS-0, and expanding the
functions ZEROP, EQUAL, DIFFERENCE, and TIMES, to the following four new
conjectures:
Case 2.4.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL B 0)
(NOT (NUMBERP C))
(EQUAL (TIMES (SUB1 A) C) 0))
(EQUAL (PLUS C (TIMES (SUB1 A) C))
0)).
But this again simplifies, applying PLUS-ZERO-ARG2, and expanding the
definitions of ZEROP and EQUAL, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL B 0)
(EQUAL C 0)
(EQUAL (TIMES (SUB1 A) C) 0))
(EQUAL (PLUS C (TIMES (SUB1 A) C))
0)).
This again simplifies, using linear arithmetic, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP B))
(NOT (NUMBERP C))
(EQUAL (TIMES (SUB1 A) C) 0))
(EQUAL (PLUS C (TIMES (SUB1 A) C))
0)),
which again simplifies, rewriting with PLUS-ZERO-ARG2, and expanding the
definitions of ZEROP and EQUAL, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP B))
(EQUAL C 0)
(EQUAL (TIMES (SUB1 A) C) 0))
(EQUAL (PLUS C (TIMES (SUB1 A) C))
0)).
However this again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP A))
(NOT (ZEROP B))
(EQUAL (TIMES (DIFFERENCE (SUB1 A) (SUB1 B))
C)
(DIFFERENCE (TIMES (SUB1 A) C)
(TIMES (SUB1 B) C))))
(EQUAL (TIMES (DIFFERENCE A B) C)
(DIFFERENCE (TIMES A C)
(TIMES B C)))),
which simplifies, appealing to the lemmas COMMUTATIVITY-OF-TIMES and
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and opening up the definitions of
ZEROP, DIFFERENCE, TIMES, and FIX, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
TIMES-DISTRIBUTES-OVER-DIFFERENCE-PROOF
(LEMMA TIMES-DISTRIBUTES-OVER-DIFFERENCE
(REWRITE)
(AND (EQUAL (TIMES (DIFFERENCE A B) C)
(DIFFERENCE (TIMES A C) (TIMES B C)))
(EQUAL (TIMES A (DIFFERENCE B C))
(DIFFERENCE (TIMES A B) (TIMES A C))))
((USE (TIMES-DISTRIBUTES-OVER-DIFFERENCE-PROOF (A A)
(B B)
(C C))
(TIMES-DISTRIBUTES-OVER-DIFFERENCE-PROOF (A B)
(B C)
(C A)))
(ENABLE COMMUTATIVITY-OF-TIMES)))
WARNING: the previously added lemma, COMMUTATIVITY-OF-TIMES, could be applied
whenever the newly proposed TIMES-DISTRIBUTES-OVER-DIFFERENCE could!
WARNING: the previously added lemma, COMMUTATIVITY-OF-TIMES, could be applied
whenever the newly proposed TIMES-DISTRIBUTES-OVER-DIFFERENCE could!
WARNING: Note that the proposed lemma TIMES-DISTRIBUTES-OVER-DIFFERENCE is to
be stored as zero type prescription rules, zero compound recognizer rules,
zero linear rules, and two replacement rules.
This formula simplifies, applying COMMUTATIVITY-OF-TIMES, and opening up the
definition of AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-DISTRIBUTES-OVER-DIFFERENCE
(LEMMA TIMES-QUOTIENT-PROOF NIL
(IMPLIES (AND (NOT (ZEROP X))
(EQUAL (REMAINDER Y X) 0))
(EQUAL (TIMES (QUOTIENT Y X) X)
(FIX Y)))
((ENABLE TIMES-ZERO TIMES-ADD1)
(INDUCT (REMAINDER Y X))))
This formula can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to the following three new formulas:
Case 3. (IMPLIES (AND (ZEROP X)
(NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (REMAINDER Y X) 0))
(EQUAL (TIMES (QUOTIENT Y X) X)
(FIX Y))).
This simplifies, opening up the function ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(LESSP Y X)
(EQUAL (REMAINDER Y X) 0))
(EQUAL (TIMES (QUOTIENT Y X) X)
(FIX Y))).
This simplifies, expanding REMAINDER, LESSP, EQUAL, QUOTIENT, TIMES, and FIX,
to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (LESSP Y X))
(IMPLIES (AND (NOT (ZEROP X))
(EQUAL (REMAINDER (DIFFERENCE Y X) X)
0))
(EQUAL (TIMES (QUOTIENT (DIFFERENCE Y X) X)
X)
(FIX (DIFFERENCE Y X))))
(EQUAL (REMAINDER Y X) 0))
(EQUAL (TIMES (QUOTIENT Y X) X)
(FIX Y))).
This simplifies, appealing to the lemma SUB1-ADD1, and unfolding the
functions ZEROP, NOT, AND, FIX, IMPLIES, REMAINDER, QUOTIENT, and TIMES, to
the following two new conjectures:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (LESSP Y X))
(EQUAL (TIMES (QUOTIENT (DIFFERENCE Y X) X)
X)
(DIFFERENCE Y X))
(EQUAL (REMAINDER (DIFFERENCE Y X) X)
0)
(NOT (NUMBERP Y)))
(EQUAL (PLUS X (DIFFERENCE Y X)) 0)).
However this again simplifies, opening up the definition of LESSP, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (LESSP Y X))
(EQUAL (TIMES (QUOTIENT (DIFFERENCE Y X) X)
X)
(DIFFERENCE Y X))
(EQUAL (REMAINDER (DIFFERENCE Y X) X)
0)
(NUMBERP Y))
(EQUAL (PLUS X (DIFFERENCE Y X)) Y)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-QUOTIENT-PROOF
(LEMMA TIMES-QUOTIENT
(REWRITE)
(IMPLIES (AND (NOT (ZEROP Y))
(EQUAL (REMAINDER X Y) 0))
(AND (EQUAL (TIMES (QUOTIENT X Y) Y)
(FIX X))
(EQUAL (TIMES Y (QUOTIENT X Y))
(FIX X))))
((USE (TIMES-QUOTIENT-PROOF (X Y) (Y X)))
(ENABLE COMMUTATIVITY-OF-TIMES)))
WARNING: the previously added lemma, COMMUTATIVITY-OF-TIMES, could be applied
whenever the newly proposed TIMES-QUOTIENT could!
WARNING: the previously added lemma, COMMUTATIVITY-OF-TIMES, could be applied
whenever the newly proposed TIMES-QUOTIENT could!
WARNING: Note that the proposed lemma TIMES-QUOTIENT is to be stored as zero
type prescription rules, zero compound recognizer rules, zero linear rules,
and two replacement rules.
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to:
(IMPLIES (AND (IMPLIES (AND (NOT (ZEROP Y))
(EQUAL (REMAINDER X Y) 0))
(EQUAL (TIMES (QUOTIENT X Y) Y)
(FIX X)))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(EQUAL (REMAINDER X Y) 0))
(AND (EQUAL (TIMES (QUOTIENT X Y) Y)
(FIX X))
(EQUAL (TIMES Y (QUOTIENT X Y))
(FIX X)))).
This simplifies, rewriting with COMMUTATIVITY-OF-TIMES, and opening up the
definitions of ZEROP, NOT, EQUAL, AND, FIX, IMPLIES, LESSP, REMAINDER,
QUOTIENT, and TIMES, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-QUOTIENT
(LEMMA TIMES-1-ARG1
(REWRITE)
(EQUAL (TIMES 1 X) (FIX X))
((ENABLE TIMES-ZERO)))
WARNING: the previously added lemma, COMMUTATIVITY-OF-TIMES, could be applied
whenever the newly proposed TIMES-1-ARG1 could!
This simplifies, unfolding FIX, to two new formulas:
Case 2. (IMPLIES (NOT (NUMBERP X))
(EQUAL (TIMES 1 X) 0)),
which again simplifies, rewriting with TIMES-ZERO, and unfolding the
definitions of ZEROP and EQUAL, to:
T.
Case 1. (IMPLIES (NUMBERP X)
(EQUAL (TIMES 1 X) X)).
This again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-1-ARG1
(LEMMA LESSP-TIMES1-PROOF NIL
(IMPLIES (AND (LESSP A B) (NOT (ZEROP C)))
(EQUAL (LESSP A (TIMES B C)) T)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to the goal:
(IMPLIES (AND (LESSP A B)
(NOT (EQUAL C 0))
(NUMBERP C))
(EQUAL (LESSP A (TIMES B C)) T)).
This simplifies, obviously, to:
(IMPLIES (AND (LESSP A B)
(NOT (EQUAL C 0))
(NUMBERP C))
(LESSP A (TIMES B C))),
which we will name *1.
Perhaps we can prove it by induction. There are four plausible
inductions. However, they merge into one likely candidate induction. We will
induct according to the following scheme:
(AND (IMPLIES (OR (EQUAL B 0) (NOT (NUMBERP B)))
(p A B C))
(IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(OR (EQUAL A 0) (NOT (NUMBERP A))))
(p A B C))
(IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(p (SUB1 A) (SUB1 B) C))
(p A B C))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT can be used to show that the measure (COUNT A) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. Note, however, the inductive instance chosen for B. The above
induction scheme generates four new formulas:
Case 4. (IMPLIES (AND (OR (EQUAL B 0) (NOT (NUMBERP B)))
(LESSP A B)
(NOT (EQUAL C 0))
(NUMBERP C))
(LESSP A (TIMES B C))),
which simplifies, opening up NOT, OR, EQUAL, and LESSP, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(OR (EQUAL A 0) (NOT (NUMBERP A)))
(LESSP A B)
(NOT (EQUAL C 0))
(NUMBERP C))
(LESSP A (TIMES B C))),
which simplifies, expanding NOT, OR, EQUAL, LESSP, and TIMES, to two new
formulas:
Case 3.2.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(EQUAL A 0)
(NOT (EQUAL C 0))
(NUMBERP C))
(NOT (EQUAL (PLUS C (TIMES (SUB1 B) C))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (NUMBERP A))
(NOT (EQUAL C 0))
(NUMBERP C))
(NOT (EQUAL (PLUS C (TIMES (SUB1 B) C))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (LESSP (SUB1 A) (SUB1 B)))
(LESSP A B)
(NOT (EQUAL C 0))
(NUMBERP C))
(LESSP A (TIMES B C))),
which simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP A 1)
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (LESSP (SUB1 A) (SUB1 B)))
(LESSP A B)
(NOT (EQUAL C 0))
(NUMBERP C))
(LESSP A (TIMES B C))).
But this again simplifies, expanding the definitions of SUB1, NUMBERP, EQUAL,
LESSP, NOT, and OR, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(LESSP (SUB1 A) (TIMES (SUB1 B) C))
(LESSP A B)
(NOT (EQUAL C 0))
(NUMBERP C))
(LESSP A (TIMES B C))),
which simplifies, expanding the definitions of NOT, OR, LESSP, and TIMES, to:
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP (SUB1 A) (TIMES (SUB1 B) C))
(LESSP (SUB1 A) (SUB1 B))
(NOT (EQUAL C 0))
(NUMBERP C))
(LESSP A
(PLUS C (TIMES (SUB1 B) C)))).
But this again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-TIMES1-PROOF
(LEMMA LESSP-TIMES1
(REWRITE)
(IMPLIES (AND (LESSP A B) (NOT (ZEROP C)))
(AND (EQUAL (LESSP A (TIMES B C)) T)
(EQUAL (LESSP A (TIMES C B)) T)))
((ENABLE COMMUTATIVITY-OF-TIMES)
(USE (LESSP-TIMES1-PROOF (A A)
(B B)
(C C)))
(DO-NOT-INDUCT T)))
WARNING: Note that the proposed lemma LESSP-TIMES1 is to be stored as zero
type prescription rules, zero compound recognizer rules, zero linear rules,
and two replacement rules.
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to:
(IMPLIES (AND (IMPLIES (AND (LESSP A B) (NOT (ZEROP C)))
(EQUAL (LESSP A (TIMES B C)) T))
(LESSP A B)
(NOT (EQUAL C 0))
(NUMBERP C))
(AND (EQUAL (LESSP A (TIMES B C)) T)
(EQUAL (LESSP A (TIMES C B)) T))).
This simplifies, appealing to the lemma COMMUTATIVITY-OF-TIMES, and expanding
ZEROP, NOT, AND, IMPLIES, and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-TIMES1
(LEMMA LESSP-TIMES2-PROOF NIL
(IMPLIES (AND (LEQ A B) (NOT (ZEROP C)))
(EQUAL (LESSP (TIMES B C) A) F)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to:
(IMPLIES (AND (NOT (LESSP B A))
(NOT (EQUAL C 0))
(NUMBERP C))
(EQUAL (LESSP (TIMES B C) A) F)).
This simplifies, clearly, to the new formula:
(IMPLIES (AND (NOT (LESSP B A))
(NOT (EQUAL C 0))
(NUMBERP C))
(NOT (LESSP (TIMES B C) A))),
which we will name *1.
Perhaps we can prove it by induction. Four inductions are suggested by
terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (OR (EQUAL A 0) (NOT (NUMBERP A)))
(p B C A))
(IMPLIES (AND (NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(OR (EQUAL B 0) (NOT (NUMBERP B))))
(p B C A))
(IMPLIES (AND (NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(p (SUB1 B) C (SUB1 A)))
(p B C A))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT inform us that the measure (COUNT B) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for A. The above induction scheme
generates the following four new conjectures:
Case 4. (IMPLIES (AND (OR (EQUAL A 0) (NOT (NUMBERP A)))
(NOT (LESSP B A))
(NOT (EQUAL C 0))
(NUMBERP C))
(NOT (LESSP (TIMES B C) A))).
This simplifies, unfolding the definitions of NOT, OR, EQUAL, LESSP, and
TIMES, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(OR (EQUAL B 0) (NOT (NUMBERP B)))
(NOT (LESSP B A))
(NOT (EQUAL C 0))
(NUMBERP C))
(NOT (LESSP (TIMES B C) A))).
This simplifies, expanding the functions NOT, OR, EQUAL, and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(LESSP (SUB1 B) (SUB1 A))
(NOT (LESSP B A))
(NOT (EQUAL C 0))
(NUMBERP C))
(NOT (LESSP (TIMES B C) A))).
This simplifies, using linear arithmetic, to the new goal:
(IMPLIES (AND (LESSP A 1)
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(LESSP (SUB1 B) (SUB1 A))
(NOT (LESSP B A))
(NOT (EQUAL C 0))
(NUMBERP C))
(NOT (LESSP (TIMES B C) A))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (LESSP (TIMES (SUB1 B) C) (SUB1 A)))
(NOT (LESSP B A))
(NOT (EQUAL C 0))
(NUMBERP C))
(NOT (LESSP (TIMES B C) A))),
which simplifies, unfolding the definitions of NOT, OR, LESSP, and TIMES, to:
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (TIMES (SUB1 B) C) (SUB1 A)))
(NOT (LESSP (SUB1 B) (SUB1 A)))
(NOT (EQUAL C 0))
(NUMBERP C))
(NOT (LESSP (PLUS C (TIMES (SUB1 B) C))
A))).
However this again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-TIMES2-PROOF
(LEMMA LESSP-TIMES2
(REWRITE)
(IMPLIES (AND (LEQ A B) (NOT (ZEROP C)))
(AND (EQUAL (LESSP (TIMES B C) A) F)
(EQUAL (LESSP (TIMES C B) A) F)))
((ENABLE COMMUTATIVITY-OF-TIMES)
(USE (LESSP-TIMES2-PROOF (A A)
(B B)
(C C)))
(DO-NOT-INDUCT T)))
WARNING: Note that the proposed lemma LESSP-TIMES2 is to be stored as zero
type prescription rules, zero compound recognizer rules, zero linear rules,
and two replacement rules.
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to:
(IMPLIES (AND (IMPLIES (AND (IF (LESSP B A) F T)
(NOT (ZEROP C)))
(EQUAL (LESSP (TIMES B C) A) F))
(NOT (LESSP B A))
(NOT (EQUAL C 0))
(NUMBERP C))
(AND (EQUAL (LESSP (TIMES B C) A) F)
(EQUAL (LESSP (TIMES C B) A) F))).
This simplifies, rewriting with COMMUTATIVITY-OF-TIMES, and expanding the
functions ZEROP, NOT, AND, IMPLIES, and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-TIMES2
(LEMMA LESSP-TIMES3-PROOF1 NIL
(IMPLIES (AND (NOT (ZEROP A)) (LESSP 1 B))
(LESSP A (TIMES A B)))
((ENABLE-THEORY ADDITION)
(ENABLE TIMES-ZERO)))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(LESSP 1 B))
(LESSP A (TIMES A B))),
which we will name *1.
Perhaps we can prove it by induction. The recursive terms in the
conjecture suggest three inductions. They merge into two likely candidate
inductions. However, only one is unflawed. We will induct according to the
following scheme:
(AND (IMPLIES (OR (EQUAL (TIMES A B) 0)
(NOT (NUMBERP (TIMES A B))))
(p A B))
(IMPLIES (AND (NOT (OR (EQUAL (TIMES A B) 0)
(NOT (NUMBERP (TIMES A B)))))
(OR (EQUAL A 0) (NOT (NUMBERP A))))
(p A B))
(IMPLIES (AND (NOT (OR (EQUAL (TIMES A B) 0)
(NOT (NUMBERP (TIMES A B)))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(p (SUB1 A) B))
(p A B))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT establish that the measure (COUNT A) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme produces the following four new goals:
Case 4. (IMPLIES (AND (OR (EQUAL (TIMES A B) 0)
(NOT (NUMBERP (TIMES A B))))
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP 1 B))
(LESSP A (TIMES A B))).
This simplifies, applying EQUAL-PLUS-0, and opening up the definitions of
TIMES, NOT, OR, and LESSP, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (EQUAL (TIMES A B) 0)
(NOT (NUMBERP (TIMES A B)))))
(OR (EQUAL A 0) (NOT (NUMBERP A)))
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP 1 B))
(LESSP A (TIMES A B))),
which simplifies, rewriting with EQUAL-PLUS-0, and expanding the functions
TIMES, NOT, and OR, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL (TIMES A B) 0)
(NOT (NUMBERP (TIMES A B)))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(EQUAL (SUB1 A) 0)
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP 1 B))
(LESSP A (TIMES A B))).
This simplifies, applying EQUAL-PLUS-0, and unfolding the definitions of
TIMES, NOT, and OR, to two new conjectures:
Case 2.2.
(IMPLIES (AND (NOT (EQUAL (TIMES (SUB1 A) B) 0))
(EQUAL (SUB1 A) 0)
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP 1 B))
(LESSP A
(PLUS B (TIMES (SUB1 A) B)))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(EQUAL (SUB1 A) 0)
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP 1 B))
(LESSP A
(PLUS B (TIMES (SUB1 A) B)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL (TIMES A B) 0)
(NOT (NUMBERP (TIMES A B)))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(LESSP (SUB1 A) (TIMES (SUB1 A) B))
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP 1 B))
(LESSP A (TIMES A B))),
which simplifies, applying the lemma EQUAL-PLUS-0, and opening up TIMES, NOT,
and OR, to two new formulas:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL (TIMES (SUB1 A) B) 0))
(LESSP (SUB1 A) (TIMES (SUB1 A) B))
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP 1 B))
(LESSP A
(PLUS B (TIMES (SUB1 A) B)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(LESSP (SUB1 A) (TIMES (SUB1 A) B))
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP 1 B))
(LESSP A
(PLUS B (TIMES (SUB1 A) B)))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.2 0.0 ]
LESSP-TIMES3-PROOF1
(LEMMA LESSP-TIMES3-PROOF2 NIL
(IMPLIES (LESSP A (TIMES A B))
(AND (NOT (ZEROP A)) (LESSP 1 B)))
((ENABLE-THEORY ADDITION)))
This simplifies, unfolding the functions ZEROP, NOT, and AND, to the following
three new formulas:
Case 3. (IMPLIES (LESSP A (TIMES A B))
(NOT (EQUAL A 0))).
But this again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (LESSP A (TIMES A B))
(NUMBERP A)),
which again simplifies, expanding the definitions of TIMES, EQUAL, and LESSP,
to:
T.
Case 1. (IMPLIES (LESSP A (TIMES A B))
(LESSP 1 B)),
which we will name *1.
We will appeal to induction. There are three plausible inductions. They
merge into two likely candidate inductions. However, only one is unflawed.
We will induct according to the following scheme:
(AND (IMPLIES (OR (EQUAL (TIMES A B) 0)
(NOT (NUMBERP (TIMES A B))))
(p B A))
(IMPLIES (AND (NOT (OR (EQUAL (TIMES A B) 0)
(NOT (NUMBERP (TIMES A B)))))
(OR (EQUAL A 0) (NOT (NUMBERP A))))
(p B A))
(IMPLIES (AND (NOT (OR (EQUAL (TIMES A B) 0)
(NOT (NUMBERP (TIMES A B)))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(p B (SUB1 A)))
(p B A))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT establish that the measure (COUNT A) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme leads to the following three new goals:
Case 3. (IMPLIES (AND (OR (EQUAL (TIMES A B) 0)
(NOT (NUMBERP (TIMES A B))))
(LESSP A (TIMES A B)))
(LESSP 1 B)).
This simplifies, expanding TIMES, NOT, OR, EQUAL, and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL (TIMES A B) 0)
(NOT (NUMBERP (TIMES A B)))))
(OR (EQUAL A 0) (NOT (NUMBERP A)))
(LESSP A (TIMES A B)))
(LESSP 1 B)).
This simplifies, expanding the functions TIMES, NOT, and OR, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL (TIMES A B) 0)
(NOT (NUMBERP (TIMES A B)))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (LESSP (SUB1 A) (TIMES (SUB1 A) B)))
(LESSP A (TIMES A B)))
(LESSP 1 B)).
This simplifies, opening up the functions TIMES, NOT, and OR, to:
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL (PLUS B (TIMES (SUB1 A) B)) 0))
(NOT (LESSP (SUB1 A) (TIMES (SUB1 A) B)))
(LESSP A (PLUS B (TIMES (SUB1 A) B))))
(LESSP 1 B)),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-TIMES3-PROOF2
(LEMMA LESSP-TIMES3
(REWRITE)
(AND (EQUAL (LESSP A (TIMES A B))
(AND (NOT (ZEROP A)) (LESSP 1 B)))
(EQUAL (LESSP A (TIMES B A))
(AND (NOT (ZEROP A)) (LESSP 1 B))))
((ENABLE COMMUTATIVITY-OF-TIMES)
(USE (LESSP-TIMES3-PROOF1 (A A) (B B))
(LESSP-TIMES3-PROOF2 (A A) (B B)))
(DO-NOT-INDUCT T)))
WARNING: Note that the proposed lemma LESSP-TIMES3 is to be stored as zero
type prescription rules, zero compound recognizer rules, zero linear rules,
and two replacement rules.
This simplifies, applying COMMUTATIVITY-OF-TIMES, and expanding the functions
ZEROP, NOT, AND, IMPLIES, EQUAL, TIMES, and LESSP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-TIMES3
(LEMMA LESSP-TIMES-CANCELLATION-PROOF NIL
(EQUAL (LESSP (TIMES X Z) (TIMES Y Z))
(AND (NOT (ZEROP Z)) (LESSP X Y)))
((ENABLE COMMUTATIVITY-OF-TIMES CORRECTNESS-OF-CANCEL-LESSP-PLUS
TIMES-ZERO)))
This conjecture simplifies, unfolding the definitions of ZEROP, NOT, and AND,
to three new conjectures:
Case 3. (IMPLIES (NOT (NUMBERP Z))
(EQUAL (LESSP (TIMES X Z) (TIMES Y Z))
F)),
which again simplifies, rewriting with TIMES-ZERO, and opening up the
functions ZEROP, LESSP, and EQUAL, to:
T.
Case 2. (IMPLIES (EQUAL Z 0)
(EQUAL (LESSP (TIMES X Z) (TIMES Y Z))
F)).
However this again simplifies, rewriting with COMMUTATIVITY-OF-TIMES, and
unfolding the definitions of EQUAL, TIMES, and LESSP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL Z 0)) (NUMBERP Z))
(EQUAL (LESSP (TIMES X Z) (TIMES Y Z))
(LESSP X Y))).
Name the above subgoal *1.
We will appeal to induction. Four inductions are suggested by terms in
the conjecture. However, they merge into one likely candidate induction. We
will induct according to the following scheme:
(AND (IMPLIES (ZEROP X) (p X Z Y))
(IMPLIES (AND (NOT (ZEROP X))
(p (SUB1 X) Z (SUB1 Y)))
(p X Z Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT X) decreases according to the well-founded relation
LESSP in each induction step of the scheme. Note, however, the inductive
instance chosen for Y. The above induction scheme generates the following two
new formulas:
Case 2. (IMPLIES (AND (ZEROP X)
(NOT (EQUAL Z 0))
(NUMBERP Z))
(EQUAL (LESSP (TIMES X Z) (TIMES Y Z))
(LESSP X Y))).
This simplifies, expanding ZEROP, EQUAL, TIMES, and LESSP, to the following
six new goals:
Case 2.6.
(IMPLIES (AND (EQUAL X 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (EQUAL Y 0))
(EQUAL (PLUS Z (TIMES (SUB1 Y) Z)) 0))
(EQUAL F (NUMBERP Y))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.5.
(IMPLIES (AND (EQUAL X 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (EQUAL Y 0))
(NOT (NUMBERP Y)))
(EQUAL F (NUMBERP Y))),
which again simplifies, clearly, to:
T.
Case 2.4.
(IMPLIES (AND (EQUAL X 0)
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (EQUAL (PLUS Z (TIMES (SUB1 Y) Z))
0)))
(EQUAL T (NUMBERP Y))).
This again simplifies, obviously, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (NUMBERP X))
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (EQUAL Y 0))
(EQUAL (PLUS Z (TIMES (SUB1 Y) Z)) 0))
(EQUAL F (NUMBERP Y))).
But this again simplifies, using linear arithmetic, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP X))
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (EQUAL Y 0))
(NOT (NUMBERP Y)))
(EQUAL F (NUMBERP Y))),
which again simplifies, obviously, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP X))
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (EQUAL (PLUS Z (TIMES (SUB1 Y) Z))
0)))
(EQUAL T (NUMBERP Y))).
This again simplifies, obviously, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(EQUAL (LESSP (TIMES (SUB1 X) Z)
(TIMES (SUB1 Y) Z))
(LESSP (SUB1 X) (SUB1 Y)))
(NOT (EQUAL Z 0))
(NUMBERP Z))
(EQUAL (LESSP (TIMES X Z) (TIMES Y Z))
(LESSP X Y))).
This simplifies, opening up ZEROP, TIMES, and LESSP, to the following three
new goals:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (LESSP (TIMES (SUB1 X) Z)
(TIMES (SUB1 Y) Z))
(LESSP (SUB1 X) (SUB1 Y)))
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (EQUAL Y 0))
(NUMBERP Y))
(EQUAL (LESSP (PLUS Z (TIMES (SUB1 X) Z))
(PLUS Z (TIMES (SUB1 Y) Z)))
(LESSP (SUB1 X) (SUB1 Y)))).
This again simplifies, applying CORRECTNESS-OF-CANCEL-LESSP-PLUS, and
expanding FIX, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (LESSP (TIMES (SUB1 X) Z)
(TIMES (SUB1 Y) Z))
(LESSP (SUB1 X) (SUB1 Y)))
(NOT (EQUAL Z 0))
(NUMBERP Z)
(EQUAL Y 0))
(EQUAL (LESSP (PLUS Z (TIMES (SUB1 X) Z)) 0)
F)).
This again simplifies, opening up the definitions of SUB1, EQUAL, TIMES,
and LESSP, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (LESSP (TIMES (SUB1 X) Z)
(TIMES (SUB1 Y) Z))
(LESSP (SUB1 X) (SUB1 Y)))
(NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (NUMBERP Y)))
(EQUAL (LESSP (PLUS Z (TIMES (SUB1 X) Z)) 0)
F)),
which again simplifies, unfolding the definitions of EQUAL and LESSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-TIMES-CANCELLATION-PROOF
(LEMMA LESSP-TIMES-CANCELLATION1
(REWRITE)
(AND (EQUAL (LESSP (TIMES X Z) (TIMES Y Z))
(AND (NOT (ZEROP Z)) (LESSP X Y)))
(EQUAL (LESSP (TIMES Z X) (TIMES Y Z))
(AND (NOT (ZEROP Z)) (LESSP X Y)))
(EQUAL (LESSP (TIMES X Z) (TIMES Z Y))
(AND (NOT (ZEROP Z)) (LESSP X Y)))
(EQUAL (LESSP (TIMES Z X) (TIMES Z Y))
(AND (NOT (ZEROP Z)) (LESSP X Y))))
((USE (LESSP-TIMES-CANCELLATION-PROOF (X X)
(Y Y)
(Z Z)))
(ENABLE COMMUTATIVITY-OF-TIMES)
(DO-NOT-INDUCT T)))
WARNING: Note that the proposed lemma LESSP-TIMES-CANCELLATION1 is to be
stored as zero type prescription rules, zero compound recognizer rules, zero
linear rules, and four replacement rules.
This conjecture simplifies, rewriting with COMMUTATIVITY-OF-TIMES, and opening
up the definitions of ZEROP, NOT, AND, EQUAL, TIMES, and LESSP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-TIMES-CANCELLATION1
(DISABLE LESSP-TIMES-CANCELLATION1)
[ 0.0 0.0 0.0 ]
LESSP-TIMES-CANCELLATION1-OFF
(LEMMA LESSP-PLUS-TIMES-PROOF NIL
(IMPLIES (LESSP X A)
(EQUAL (LESSP (PLUS X (TIMES A B))
(TIMES A C))
(LESSP B C)))
((ENABLE-THEORY ADDITION)
(ENABLE COMMUTATIVITY-OF-TIMES LESSP-TIMES-CANCELLATION1 LESSP-TIMES1
LESSP-TIMES2 LESSP-TIMES3 TIMES-ADD1 TIMES-ZERO)
(INDUCT (LESSP B C))))
This conjecture can be simplified, using the abbreviations IMPLIES, NOT, OR,
and AND, to three new formulas:
Case 3. (IMPLIES (AND (OR (EQUAL C 0) (NOT (NUMBERP C)))
(LESSP X A))
(EQUAL (LESSP (PLUS X (TIMES A B))
(TIMES A C))
(LESSP B C))),
which simplifies, rewriting with COMMUTATIVITY-OF-TIMES and TIMES-ZERO, and
unfolding the definitions of NOT, OR, EQUAL, TIMES, LESSP, and ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(OR (EQUAL B 0) (NOT (NUMBERP B)))
(LESSP X A))
(EQUAL (LESSP (PLUS X (TIMES A B))
(TIMES A C))
(LESSP B C))).
This simplifies, rewriting with COMMUTATIVITY-OF-TIMES, PLUS-ZERO-ARG2, and
TIMES-ZERO, and opening up NOT, OR, EQUAL, TIMES, ZEROP, and LESSP, to four
new conjectures:
Case 2.4.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(EQUAL B 0)
(LESSP X A)
(NOT (NUMBERP X)))
(LESSP 0 (TIMES A C))),
which again simplifies, using linear arithmetic, applying LESSP-TIMES1,
and expanding LESSP, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(EQUAL B 0)
(LESSP X A)
(NUMBERP X))
(LESSP X (TIMES A C))).
But this again simplifies, rewriting with the lemma LESSP-TIMES1, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (NUMBERP B))
(LESSP X A)
(NOT (NUMBERP X)))
(LESSP 0 (TIMES A C))),
which again simplifies, using linear arithmetic, rewriting with
LESSP-TIMES1, and opening up the definition of LESSP, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (NUMBERP B))
(LESSP X A)
(NUMBERP X))
(LESSP X (TIMES A C))).
But this again simplifies, applying LESSP-TIMES1, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (EQUAL B 0))
(NUMBERP B)
(IMPLIES (LESSP X A)
(EQUAL (LESSP (PLUS X (TIMES A (SUB1 B)))
(TIMES A (SUB1 C)))
(LESSP (SUB1 B) (SUB1 C))))
(LESSP X A))
(EQUAL (LESSP (PLUS X (TIMES A B))
(TIMES A C))
(LESSP B C))).
This simplifies, opening up IMPLIES and LESSP, to:
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (EQUAL B 0))
(NUMBERP B)
(EQUAL (LESSP (PLUS X (TIMES A (SUB1 B)))
(TIMES A (SUB1 C)))
(LESSP (SUB1 B) (SUB1 C)))
(LESSP X A))
(EQUAL (LESSP (PLUS X (TIMES A B))
(TIMES A C))
(LESSP (SUB1 B) (SUB1 C)))).
Applying the lemma SUB1-ELIM, replace B by (ADD1 Z) to eliminate (SUB1 B).
We use the type restriction lemma noted when SUB1 was introduced to restrict
the new variable. This produces:
(IMPLIES (AND (NUMBERP Z)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (EQUAL (ADD1 Z) 0))
(EQUAL (LESSP (PLUS X (TIMES A Z))
(TIMES A (SUB1 C)))
(LESSP Z (SUB1 C)))
(LESSP X A))
(EQUAL (LESSP (PLUS X (TIMES A (ADD1 Z)))
(TIMES A C))
(LESSP Z (SUB1 C)))),
which further simplifies, rewriting with the lemmas TIMES-ADD1 and
COMMUTATIVITY2-OF-PLUS, to the conjecture:
(IMPLIES (AND (NUMBERP Z)
(NOT (EQUAL C 0))
(NUMBERP C)
(EQUAL (LESSP (PLUS X (TIMES A Z))
(TIMES A (SUB1 C)))
(LESSP Z (SUB1 C)))
(LESSP X A))
(EQUAL (LESSP (PLUS A X (TIMES A Z))
(TIMES A C))
(LESSP Z (SUB1 C)))).
Appealing to the lemma SUB1-ELIM, we now replace C by (ADD1 V) to eliminate
(SUB1 C). We use the type restriction lemma noted when SUB1 was introduced
to constrain the new variable. The result is:
(IMPLIES (AND (NUMBERP V)
(NUMBERP Z)
(NOT (EQUAL (ADD1 V) 0))
(EQUAL (LESSP (PLUS X (TIMES A Z))
(TIMES A V))
(LESSP Z V))
(LESSP X A))
(EQUAL (LESSP (PLUS A X (TIMES A Z))
(TIMES A (ADD1 V)))
(LESSP Z V))).
However this further simplifies, applying TIMES-ADD1 and
CORRECTNESS-OF-CANCEL-LESSP-PLUS, and expanding the definition of FIX, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
LESSP-PLUS-TIMES-PROOF
(LEMMA LESSP-PLUS-TIMES1
(REWRITE)
(AND (EQUAL (LESSP (PLUS A (TIMES B C)) B)
(AND (LESSP A B) (ZEROP C)))
(EQUAL (LESSP (PLUS A (TIMES C B)) B)
(AND (LESSP A B) (ZEROP C)))
(EQUAL (LESSP (PLUS (TIMES C B) A) B)
(AND (LESSP A B) (ZEROP C)))
(EQUAL (LESSP (PLUS (TIMES B C) A) B)
(AND (LESSP A B) (ZEROP C))))
((USE (LESSP-PLUS-TIMES-PROOF (A B)
(B C)
(C 1)
(X A)))
(ENABLE COMMUTATIVITY-OF-PLUS COMMUTATIVITY-OF-TIMES TIMES-1-ARG1)
(DO-NOT-INDUCT T)))
WARNING: Note that the proposed lemma LESSP-PLUS-TIMES1 is to be stored as
zero type prescription rules, zero compound recognizer rules, zero linear
rules, and four replacement rules.
This formula simplifies, applying TIMES-1-ARG1, COMMUTATIVITY-OF-TIMES, and
COMMUTATIVITY-OF-PLUS, and unfolding IMPLIES, ZEROP, AND, TIMES, EQUAL, PLUS,
and LESSP, to five new goals:
Case 5. (IMPLIES (NOT (LESSP A B))
(NOT (LESSP (PLUS A (TIMES B C)) B))),
which again simplifies, using linear arithmetic, to:
T.
Case 4. (IMPLIES (AND (NUMBERP B)
(EQUAL (LESSP (PLUS A (TIMES B C)) B)
(LESSP C 1))
(NOT (EQUAL C 0))
(NUMBERP C))
(EQUAL (LESSP C 1) F)),
which again simplifies, obviously, to:
(IMPLIES (AND (NUMBERP B)
(LESSP (PLUS A (TIMES B C)) B)
(NOT (EQUAL C 0))
(NUMBERP C))
(NOT (LESSP C 1))),
which again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (NUMBERP B)
(EQUAL (LESSP (PLUS A (TIMES B C)) B)
(LESSP C 1))
(NOT (LESSP A B)))
(EQUAL (LESSP C 1) F)),
which again simplifies, trivially, to the new conjecture:
(IMPLIES (AND (NUMBERP B)
(LESSP (PLUS A (TIMES B C)) B)
(NOT (LESSP A B)))
(NOT (LESSP C 1))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NUMBERP B)
(EQUAL (LESSP (PLUS A (TIMES B C)) B)
(LESSP C 1))
(LESSP A B)
(NOT (NUMBERP C)))
(EQUAL (LESSP C 1) T)),
which again simplifies, unfolding the functions NUMBERP, EQUAL, and LESSP,
to:
T.
Case 1. (IMPLIES (AND (NUMBERP B)
(EQUAL (LESSP (PLUS A (TIMES B C)) B)
(LESSP C 1))
(LESSP A B)
(EQUAL C 0))
(EQUAL (LESSP C 1) T)),
which again simplifies, applying COMMUTATIVITY-OF-TIMES and
COMMUTATIVITY-OF-PLUS, and unfolding the functions EQUAL, TIMES, PLUS, and
LESSP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-PLUS-TIMES1
(LEMMA LESSP-PLUS-TIMES2
(REWRITE)
(IMPLIES (AND (NOT (ZEROP A)) (LESSP X A))
(AND (EQUAL (LESSP (PLUS X (TIMES A B))
(TIMES A C))
(LESSP B C))
(EQUAL (LESSP (PLUS X (TIMES B A))
(TIMES A C))
(LESSP B C))
(EQUAL (LESSP (PLUS X (TIMES A B))
(TIMES C A))
(LESSP B C))
(EQUAL (LESSP (PLUS X (TIMES B A))
(TIMES C A))
(LESSP B C))
(EQUAL (LESSP (PLUS (TIMES A B) X)
(TIMES A C))
(LESSP B C))
(EQUAL (LESSP (PLUS (TIMES B A) X)
(TIMES A C))
(LESSP B C))
(EQUAL (LESSP (PLUS (TIMES A B) X)
(TIMES C A))
(LESSP B C))
(EQUAL (LESSP (PLUS (TIMES B A) X)
(TIMES C A))
(LESSP B C))))
((ENABLE COMMUTATIVITY-OF-PLUS COMMUTATIVITY-OF-TIMES)
(USE (LESSP-PLUS-TIMES-PROOF (A A)
(B B)
(C C)
(X X)))
(DO-NOT-INDUCT T)))
WARNING: Note that the proposed lemma LESSP-PLUS-TIMES2 is to be stored as
zero type prescription rules, zero compound recognizer rules, zero linear
rules, and eight replacement rules.
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to:
(IMPLIES (AND (IMPLIES (LESSP X A)
(EQUAL (LESSP (PLUS X (TIMES A B))
(TIMES A C))
(LESSP B C)))
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP X A))
(AND (EQUAL (LESSP (PLUS X (TIMES A B))
(TIMES A C))
(LESSP B C))
(EQUAL (LESSP (PLUS X (TIMES B A))
(TIMES A C))
(LESSP B C))
(EQUAL (LESSP (PLUS X (TIMES A B))
(TIMES C A))
(LESSP B C))
(EQUAL (LESSP (PLUS X (TIMES B A))
(TIMES C A))
(LESSP B C))
(EQUAL (LESSP (PLUS (TIMES A B) X)
(TIMES A C))
(LESSP B C))
(EQUAL (LESSP (PLUS (TIMES B A) X)
(TIMES A C))
(LESSP B C))
(EQUAL (LESSP (PLUS (TIMES A B) X)
(TIMES C A))
(LESSP B C))
(EQUAL (LESSP (PLUS (TIMES B A) X)
(TIMES C A))
(LESSP B C)))).
This simplifies, applying COMMUTATIVITY-OF-TIMES and COMMUTATIVITY-OF-PLUS,
and expanding IMPLIES and AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-PLUS-TIMES2
(LEMMA LESSP-1-TIMES
(REWRITE)
(EQUAL (LESSP 1 (TIMES A B))
(NOT (OR (ZEROP A)
(ZEROP B)
(AND (EQUAL A 1) (EQUAL B 1))))))
This conjecture simplifies, opening up ZEROP, AND, OR, and NOT, to seven new
goals:
Case 7. (IMPLIES (EQUAL B 0)
(EQUAL (LESSP 1 (TIMES A B)) F)),
which again simplifies, trivially, to the new conjecture:
(NOT (LESSP 1 (TIMES A 0))),
which we will name *1.
Case 6. (IMPLIES (NOT (NUMBERP B))
(EQUAL (LESSP 1 (TIMES A B)) F)).
This again simplifies, obviously, to the new conjecture:
(IMPLIES (NOT (NUMBERP B))
(NOT (LESSP 1 (TIMES A B)))),
which we would normally push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us return to:
(EQUAL (LESSP 1 (TIMES A B))
(NOT (OR (ZEROP A)
(ZEROP B)
(AND (EQUAL A 1) (EQUAL B 1))))).
We named this *1. We will try to prove it by induction. There is only one
suggested induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP A) (p A B))
(IMPLIES (AND (NOT (ZEROP A)) (p (SUB1 A) B))
(p A B))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT A) decreases according to the well-founded relation
LESSP in each induction step of the scheme. The above induction scheme leads
to two new goals:
Case 2. (IMPLIES (ZEROP A)
(EQUAL (LESSP 1 (TIMES A B))
(NOT (OR (ZEROP A)
(ZEROP B)
(AND (EQUAL A 1) (EQUAL B 1)))))),
which simplifies, expanding the functions ZEROP, EQUAL, TIMES, LESSP, AND,
OR, and NOT, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP A))
(EQUAL (LESSP 1 (TIMES (SUB1 A) B))
(NOT (OR (ZEROP (SUB1 A))
(ZEROP B)
(AND (EQUAL (SUB1 A) 1)
(EQUAL B 1))))))
(EQUAL (LESSP 1 (TIMES A B))
(NOT (OR (ZEROP A)
(ZEROP B)
(AND (EQUAL A 1) (EQUAL B 1)))))),
which simplifies, opening up the functions ZEROP, AND, OR, NOT, PLUS, TIMES,
LESSP, and EQUAL, to 11 new formulas:
Case 1.11.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (SUB1 A) 1)
(EQUAL B 1)
(EQUAL (LESSP 1 (TIMES (SUB1 A) B))
F))
(NOT (EQUAL A 1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.10.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL B 0)
(EQUAL (LESSP 1 (TIMES (SUB1 A) B))
F))
(NOT (LESSP 1 (TIMES A 0)))),
which again simplifies, obviously, to the new conjecture:
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (LESSP 1 (TIMES (SUB1 A) 0))))
(NOT (LESSP 1 (TIMES A 0)))),
which again simplifies, opening up the definitions of PLUS, EQUAL, and
TIMES, to:
T.
Case 1.9.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (SUB1 A) 0)
(EQUAL (LESSP 1 (TIMES (SUB1 A) B)) F)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL B 1)))
(EQUAL (LESSP 1 (PLUS B (TIMES (SUB1 A) B)))
T)),
which again simplifies, expanding EQUAL, TIMES, and LESSP, to:
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (SUB1 A) 0)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL B 1)))
(LESSP 1 (PLUS B 0))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.8.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (SUB1 A) 0)
(EQUAL (LESSP 1 (TIMES (SUB1 A) B)) F)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL A 1)))
(EQUAL (LESSP 1 (PLUS B (TIMES (SUB1 A) B)))
T)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (SUB1 A) 0)
(EQUAL (LESSP 1 (TIMES (SUB1 A) B)) F)
(EQUAL A 1)
(EQUAL B 1))
(EQUAL (LESSP 1 (PLUS B (TIMES (SUB1 A) B)))
F)),
which again simplifies, unfolding the definitions of EQUAL, NUMBERP, SUB1,
TIMES, LESSP, and PLUS, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (SUB1 A) 0)
(EQUAL (LESSP 1 (TIMES (SUB1 A) B)) F)
(NOT (NUMBERP B)))
(EQUAL (LESSP 1 (PLUS B (TIMES (SUB1 A) B)))
F)),
which again simplifies, expanding the definitions of EQUAL, TIMES, LESSP,
NUMBERP, and PLUS, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (SUB1 A) 0)
(EQUAL (LESSP 1 (TIMES (SUB1 A) B)) F)
(EQUAL B 0))
(EQUAL (LESSP 1 (PLUS B (TIMES (SUB1 A) B)))
F)),
which again simplifies, opening up the functions TIMES, LESSP, EQUAL, and
PLUS, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL (SUB1 A) 0))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL (SUB1 A) 1))
(EQUAL (LESSP 1 (TIMES (SUB1 A) B)) T)
(NOT (EQUAL A 1)))
(EQUAL (LESSP 1 (PLUS B (TIMES (SUB1 A) B)))
T)),
which again simplifies, clearly, to:
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL (SUB1 A) 0))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL (SUB1 A) 1))
(LESSP 1 (TIMES (SUB1 A) B))
(NOT (EQUAL A 1)))
(LESSP 1
(PLUS B (TIMES (SUB1 A) B)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL (SUB1 A) 0))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL (SUB1 A) 1))
(EQUAL (LESSP 1 (TIMES (SUB1 A) B)) T)
(NOT (EQUAL B 1)))
(EQUAL (LESSP 1 (PLUS B (TIMES (SUB1 A) B)))
T)),
which again simplifies, clearly, to:
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL (SUB1 A) 0))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL (SUB1 A) 1))
(LESSP 1 (TIMES (SUB1 A) B))
(NOT (EQUAL B 1)))
(LESSP 1
(PLUS B (TIMES (SUB1 A) B)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL (SUB1 A) 0))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL (SUB1 A) 1))
(EQUAL (LESSP 1 (TIMES (SUB1 A) B)) T)
(EQUAL A 1)
(EQUAL B 1))
(EQUAL (LESSP 1 (PLUS B (TIMES (SUB1 A) B)))
F)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL (SUB1 A) 0))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL B 1))
(EQUAL (LESSP 1 (TIMES (SUB1 A) B))
T))
(LESSP 1
(PLUS B (TIMES (SUB1 A) B)))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.1 ]
LESSP-1-TIMES
(DEFN TIMES-TREE
(X)
(IF (NLISTP X)
''1
(IF (NLISTP (CDR X))
(LIST 'FIX (CAR X))
(IF (NLISTP (CDDR X))
(LIST 'TIMES (CAR X) (CADR X))
(LIST 'TIMES
(CAR X)
(TIMES-TREE (CDR X)))))))
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT X) decreases according
to the well-founded relation LESSP in each recursive call. Hence, TIMES-TREE
is accepted under the principle of definition. Note that
(LISTP (TIMES-TREE X)) is a theorem.
[ 0.0 0.0 0.0 ]
TIMES-TREE
(DEFN TIMES-FRINGE
(X)
(IF (AND (LISTP X)
(EQUAL (CAR X) 'TIMES))
(APPEND (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))
(CONS X NIL)))
Linear arithmetic, the lemmas CAR-LESSEQP, CDR-LESSEQP, and CDR-LESSP,
and the definition of AND establish that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each recursive call. Hence,
TIMES-FRINGE is accepted under the principle of definition. Note that
(LISTP (TIMES-FRINGE X)) is a theorem.
[ 0.0 0.0 0.0 ]
TIMES-FRINGE
(DEFN OR-ZEROP-TREE
(X)
(IF (NLISTP X)
'(FALSE)
(IF (NLISTP (CDR X))
(LIST 'ZEROP (CAR X))
(IF (NLISTP (CDDR X))
(LIST 'OR
(LIST 'ZEROP (CAR X))
(LIST 'ZEROP (CADR X)))
(LIST 'OR
(LIST 'ZEROP (CAR X))
(OR-ZEROP-TREE (CDR X)))))))
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP can be used to establish that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each recursive call.
Hence, OR-ZEROP-TREE is accepted under the principle of definition. From the
definition we can conclude that (LISTP (OR-ZEROP-TREE X)) is a theorem.
[ 0.0 0.0 0.0 ]
OR-ZEROP-TREE
(DEFN AND-NOT-ZEROP-TREE
(X)
(IF (NLISTP X)
'(TRUE)
(IF (NLISTP (CDR X))
(LIST 'NOT (LIST 'ZEROP (CAR X)))
(LIST 'AND
(LIST 'NOT (LIST 'ZEROP (CAR X)))
(AND-NOT-ZEROP-TREE (CDR X))))))
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT X) decreases according
to the well-founded relation LESSP in each recursive call. Hence,
AND-NOT-ZEROP-TREE is accepted under the principle of definition. Note that:
(LISTP (AND-NOT-ZEROP-TREE X))
is a theorem.
[ 0.0 0.0 0.0 ]
AND-NOT-ZEROP-TREE
(LEMMA NUMBERP-EVAL$-TIMES
(REWRITE)
(IMPLIES (EQUAL (CAR X) 'TIMES)
(NUMBERP (EVAL$ T X A))))
.
Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
eliminate (CAR X) and (CDR X). This generates two new conjectures:
Case 2. (IMPLIES (AND (NOT (LISTP X))
(EQUAL (CAR X) 'TIMES))
(NUMBERP (EVAL$ T X A))),
which simplifies, applying CAR-NLISTP, and unfolding the function EQUAL, to:
T.
Case 1. (IMPLIES (EQUAL Z 'TIMES)
(NUMBERP (EVAL$ T (CONS Z V) A))).
However this simplifies, applying REWRITE-EVAL$, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NUMBERP-EVAL$-TIMES
(DISABLE NUMBERP-EVAL$-TIMES)
[ 0.0 0.0 0.0 ]
NUMBERP-EVAL$-TIMES-OFF
(LEMMA EVAL$-TIMES
(REWRITE)
(IMPLIES (EQUAL (CAR X) 'TIMES)
(EQUAL (EVAL$ T X A)
(TIMES (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))))
.
Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and
(CDR V), and D by (CONS V C) to eliminate (CAR D) and (CDR D). This generates
four new formulas:
Case 4. (IMPLIES (AND (NOT (LISTP X))
(EQUAL (CAR X) 'TIMES))
(EQUAL (EVAL$ T X A)
(TIMES (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))),
which simplifies, rewriting with CAR-NLISTP, and opening up the definition
of EQUAL, to:
T.
Case 3. (IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'TIMES))
(EQUAL (EVAL$ T (CONS Z V) A)
(TIMES (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A)))).
However this simplifies, applying REWRITE-EVAL$, CAR-NLISTP, and CDR-NLISTP,
and expanding the definitions of LISTP, LITATOM, EQUAL, EVAL$, CAR, and
TIMES, to:
T.
Case 2. (IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'TIMES))
(EQUAL (EVAL$ T (CONS Z (CONS W D)) A)
(TIMES (EVAL$ T W A)
(EVAL$ T (CAR D) A)))).
This simplifies, applying REWRITE-EVAL$, CAR-CONS, CDR-CONS, and CAR-NLISTP,
and expanding the definitions of LISTP, LITATOM, EQUAL, and EVAL$, to:
T.
Case 1. (IMPLIES (EQUAL Z 'TIMES)
(EQUAL (EVAL$ T
(CONS Z (CONS W (CONS V C)))
A)
(TIMES (EVAL$ T W A) (EVAL$ T V A)))).
This simplifies, appealing to the lemmas REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
EVAL$-TIMES
(DISABLE EVAL$-TIMES)
[ 0.0 0.0 0.0 ]
EVAL$-TIMES-OFF
(LEMMA EVAL$-OR
(REWRITE)
(IMPLIES (EQUAL (CAR X) 'OR)
(EQUAL (EVAL$ T X A)
(OR (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))))
This conjecture simplifies, opening up the function OR, to three new formulas:
Case 3. (IMPLIES (AND (EQUAL (CAR X) 'OR)
(EVAL$ T (CADR X) A))
(EQUAL (EVAL$ T X A) T)).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X) and V by (CONS W D) to eliminate (CAR V) and (CDR V).
This produces the following three new conjectures:
Case 3.3.
(IMPLIES (AND (NOT (LISTP X))
(EQUAL (CAR X) 'OR)
(EVAL$ T (CADR X) A))
(EQUAL (EVAL$ T X A) T)).
However this further simplifies, applying CAR-NLISTP, and expanding the
definition of EQUAL, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'OR)
(EVAL$ T (CAR V) A))
(EQUAL (EVAL$ T (CONS Z V) A) T)).
This further simplifies, applying CAR-NLISTP, REWRITE-EVAL$, and
CDR-NLISTP, and expanding the definitions of LISTP, LITATOM, EQUAL, EVAL$,
CAR, and OR, to:
T.
Case 3.1.
(IMPLIES (AND (EQUAL Z 'OR) (EVAL$ T W A))
(EQUAL (EVAL$ T (CONS Z (CONS W D)) A)
T)).
This further simplifies, appealing to the lemmas REWRITE-EVAL$, CAR-CONS,
and CDR-CONS, and opening up the definitions of OR and EQUAL, to:
T.
Case 2. (IMPLIES (AND (EQUAL (CAR X) 'OR)
(EVAL$ T (CADDR X) A))
(EQUAL (EVAL$ T X A) T)).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS D W) to eliminate (CDR V) and (CAR V), and W
by (CONS V C) to eliminate (CAR W) and (CDR W). We would thus like to prove
the following four new goals:
Case 2.4.
(IMPLIES (AND (NOT (LISTP X))
(EQUAL (CAR X) 'OR)
(EVAL$ T (CADDR X) A))
(EQUAL (EVAL$ T X A) T)).
However this further simplifies, appealing to the lemma CAR-NLISTP, and
expanding the definition of EQUAL, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'OR)
(EVAL$ T (CADR V) A))
(EQUAL (EVAL$ T (CONS Z V) A) T)),
which further simplifies, rewriting with CDR-NLISTP, REWRITE-EVAL$, and
CAR-NLISTP, and unfolding CAR, LISTP, LITATOM, EQUAL, EVAL$, and OR, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (LISTP W))
(EQUAL Z 'OR)
(EVAL$ T (CAR W) A))
(EQUAL (EVAL$ T (CONS Z (CONS D W)) A)
T)).
However this further simplifies, rewriting with CAR-NLISTP, REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, and unfolding the definitions of LISTP, LITATOM,
EQUAL, EVAL$, and OR, to:
T.
Case 2.1.
(IMPLIES (AND (EQUAL Z 'OR) (EVAL$ T V A))
(EQUAL (EVAL$ T
(CONS Z (CONS D (CONS V C)))
A)
T)).
But this further simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, and unfolding the definitions of OR and EQUAL, to:
T.
Case 1. (IMPLIES (AND (EQUAL (CAR X) 'OR)
(NOT (EVAL$ T (CADR X) A))
(NOT (EVAL$ T (CADDR X) A)))
(EQUAL (EVAL$ T X A) F)).
This again simplifies, obviously, to:
(IMPLIES (AND (EQUAL (CAR X) 'OR)
(NOT (EVAL$ T (CADR X) A))
(NOT (EVAL$ T (CADDR X) A)))
(NOT (EVAL$ T X A))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), and D
by (CONS V C) to eliminate (CAR D) and (CDR D). This produces the following
four new conjectures:
Case 1.4.
(IMPLIES (AND (NOT (LISTP X))
(EQUAL (CAR X) 'OR)
(NOT (EVAL$ T (CADR X) A))
(NOT (EVAL$ T (CADDR X) A)))
(NOT (EVAL$ T X A))).
But this further simplifies, applying CAR-NLISTP, and expanding EQUAL, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'OR)
(NOT (EVAL$ T (CAR V) A))
(NOT (EVAL$ T (CADR V) A)))
(NOT (EVAL$ T (CONS Z V) A))).
This further simplifies, appealing to the lemma CAR-NLISTP, and unfolding
the definitions of LISTP, LITATOM, EQUAL, and EVAL$, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'OR)
(NOT (EVAL$ T W A))
(NOT (EVAL$ T (CAR D) A)))
(NOT (EVAL$ T (CONS Z (CONS W D)) A))),
which further simplifies, rewriting with CAR-NLISTP, and expanding the
definitions of LISTP, LITATOM, EQUAL, and EVAL$, to:
T.
Case 1.1.
(IMPLIES (AND (EQUAL Z 'OR)
(NOT (EVAL$ T W A))
(NOT (EVAL$ T V A)))
(NOT (EVAL$ T
(CONS Z (CONS W (CONS V C)))
A))).
But this further simplifies, applying the lemmas REWRITE-EVAL$, CAR-CONS,
and CDR-CONS, and unfolding OR, to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
EVAL$-OR
(DISABLE EVAL$-OR)
[ 0.0 0.0 0.0 ]
EVAL$-OR-OFF
(LEMMA EVAL$-EQUAL
(REWRITE)
(IMPLIES (EQUAL (CAR X) 'EQUAL)
(EQUAL (EVAL$ T X A)
(EQUAL (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))))
This conjecture simplifies, trivially, to the following two new goals:
Case 2. (IMPLIES (AND (EQUAL (CAR X) 'EQUAL)
(NOT (EQUAL (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A))))
(NOT (EVAL$ T X A))).
Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and
(CDR V), and D by (CONS V C) to eliminate (CAR D) and (CDR D). We must thus
prove four new goals:
Case 2.4.
(IMPLIES (AND (NOT (LISTP X))
(EQUAL (CAR X) 'EQUAL)
(NOT (EQUAL (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A))))
(NOT (EVAL$ T X A))),
which further simplifies, rewriting with CAR-NLISTP, and opening up the
definition of EQUAL, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'EQUAL)
(NOT (EQUAL (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A))))
(NOT (EVAL$ T (CONS Z V) A))).
This further simplifies, applying CAR-NLISTP and CDR-NLISTP, and expanding
the definitions of LISTP, LITATOM, EQUAL, EVAL$, and CAR, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'EQUAL)
(NOT (EQUAL (EVAL$ T W A)
(EVAL$ T (CAR D) A))))
(NOT (EVAL$ T (CONS Z (CONS W D)) A))).
This further simplifies, applying CAR-NLISTP, REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, and opening up the functions LISTP, LITATOM, EQUAL, and EVAL$,
to:
T.
Case 2.1.
(IMPLIES (AND (EQUAL Z 'EQUAL)
(NOT (EQUAL (EVAL$ T W A) (EVAL$ T V A))))
(NOT (EVAL$ T
(CONS Z (CONS W (CONS V C)))
A))).
But this further simplifies, applying the lemmas REWRITE-EVAL$, CAR-CONS,
and CDR-CONS, to:
T.
Case 1. (IMPLIES (AND (EQUAL (CAR X) 'EQUAL)
(EQUAL (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))
(EQUAL (EVAL$ T X A) T)).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), and D
by (CONS V C) to eliminate (CAR D) and (CDR D). We thus obtain the
following four new formulas:
Case 1.4.
(IMPLIES (AND (NOT (LISTP X))
(EQUAL (CAR X) 'EQUAL)
(EQUAL (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))
(EQUAL (EVAL$ T X A) T)).
But this further simplifies, applying CAR-NLISTP, and expanding EQUAL, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'EQUAL)
(EQUAL (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A)))
(EQUAL (EVAL$ T (CONS Z V) A) T)).
However this further simplifies, rewriting with CAR-NLISTP, CDR-NLISTP,
and REWRITE-EVAL$, and expanding LISTP, LITATOM, EQUAL, EVAL$, and CAR, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'EQUAL)
(EQUAL (EVAL$ T W A)
(EVAL$ T (CAR D) A)))
(EQUAL (EVAL$ T (CONS Z (CONS W D)) A)
T)).
However this further simplifies, applying CAR-NLISTP, REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, and expanding the functions LISTP, LITATOM, EQUAL,
and EVAL$, to:
T.
Case 1.1.
(IMPLIES (AND (EQUAL Z 'EQUAL)
(EQUAL (EVAL$ T W A) (EVAL$ T V A)))
(EQUAL (EVAL$ T
(CONS Z (CONS W (CONS V C)))
A)
T)).
However this further simplifies, applying REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, and unfolding the definition of EQUAL, to:
T.
Q.E.D.
[ 0.0 0.2 0.1 ]
EVAL$-EQUAL
(DISABLE EVAL$-EQUAL)
[ 0.0 0.0 0.0 ]
EVAL$-EQUAL-OFF
(LEMMA EVAL$-LESSP
(REWRITE)
(IMPLIES (EQUAL (CAR X) 'LESSP)
(EQUAL (EVAL$ T X A)
(LESSP (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))))
.
Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and
(CDR V), and D by (CONS V C) to eliminate (CAR D) and (CDR D). This generates
four new formulas:
Case 4. (IMPLIES (AND (NOT (LISTP X))
(EQUAL (CAR X) 'LESSP))
(EQUAL (EVAL$ T X A)
(LESSP (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))),
which simplifies, rewriting with CAR-NLISTP, and opening up the definition
of EQUAL, to:
T.
Case 3. (IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'LESSP))
(EQUAL (EVAL$ T (CONS Z V) A)
(LESSP (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A)))).
However this simplifies, applying REWRITE-EVAL$, CAR-NLISTP, and CDR-NLISTP,
and expanding the definitions of LISTP, LITATOM, EQUAL, EVAL$, CAR, and
LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'LESSP))
(EQUAL (EVAL$ T (CONS Z (CONS W D)) A)
(LESSP (EVAL$ T W A)
(EVAL$ T (CAR D) A)))).
This simplifies, applying REWRITE-EVAL$, CAR-CONS, CDR-CONS, and CAR-NLISTP,
and expanding the definitions of LISTP, LITATOM, EQUAL, EVAL$, and LESSP, to:
T.
Case 1. (IMPLIES (EQUAL Z 'LESSP)
(EQUAL (EVAL$ T
(CONS Z (CONS W (CONS V C)))
A)
(LESSP (EVAL$ T W A) (EVAL$ T V A)))).
This simplifies, appealing to the lemmas REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
EVAL$-LESSP
(DISABLE EVAL$-LESSP)
[ 0.0 0.0 0.0 ]
EVAL$-LESSP-OFF
(LEMMA EVAL$-QUOTIENT
(REWRITE)
(IMPLIES (EQUAL (CAR X) 'QUOTIENT)
(EQUAL (EVAL$ T X A)
(QUOTIENT (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))))
.
Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and
(CDR V), and D by (CONS V C) to eliminate (CAR D) and (CDR D). This generates
four new formulas:
Case 4. (IMPLIES (AND (NOT (LISTP X))
(EQUAL (CAR X) 'QUOTIENT))
(EQUAL (EVAL$ T X A)
(QUOTIENT (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)))),
which simplifies, rewriting with CAR-NLISTP, and opening up the definition
of EQUAL, to:
T.
Case 3. (IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'QUOTIENT))
(EQUAL (EVAL$ T (CONS Z V) A)
(QUOTIENT (EVAL$ T (CAR V) A)
(EVAL$ T (CADR V) A)))).
However this simplifies, applying REWRITE-EVAL$, CAR-NLISTP, and CDR-NLISTP,
and expanding the definitions of LISTP, LITATOM, EQUAL, EVAL$, CAR, and
QUOTIENT, to:
T.
Case 2. (IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'QUOTIENT))
(EQUAL (EVAL$ T (CONS Z (CONS W D)) A)
(QUOTIENT (EVAL$ T W A)
(EVAL$ T (CAR D) A)))).
This simplifies, applying REWRITE-EVAL$, CAR-CONS, CDR-CONS, and CAR-NLISTP,
and expanding the definitions of LISTP, LITATOM, EQUAL, EVAL$, and QUOTIENT,
to:
T.
Case 1. (IMPLIES (EQUAL Z 'QUOTIENT)
(EQUAL (EVAL$ T
(CONS Z (CONS W (CONS V C)))
A)
(QUOTIENT (EVAL$ T W A)
(EVAL$ T V A)))).
This simplifies, appealing to the lemmas REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
EVAL$-QUOTIENT
(DISABLE EVAL$-QUOTIENT)
[ 0.0 0.0 0.0 ]
EVAL$-QUOTIENT-OFF
(LEMMA EVAL$-IF
(REWRITE)
(IMPLIES (EQUAL (CAR X) 'IF)
(EQUAL (EVAL$ T X A)
(IF (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A)
(EVAL$ T (CADDDR X) A)))))
This formula simplifies, clearly, to two new conjectures:
Case 2. (IMPLIES (AND (EQUAL (CAR X) 'IF)
(NOT (EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T X A)
(EVAL$ T (CADDDR X) A))).
Applying the lemma CAR-CDR-ELIM, replace X by (CONS Z V) to eliminate
(CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and (CDR V), D by
(CONS C V) to eliminate (CDR D) and (CAR D), and V by (CONS D X1) to
eliminate (CAR V) and (CDR V). We thus obtain the following five new goals:
Case 2.5.
(IMPLIES (AND (NOT (LISTP X))
(EQUAL (CAR X) 'IF)
(NOT (EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T X A)
(EVAL$ T (CADDDR X) A))).
But this further simplifies, applying CAR-NLISTP, and unfolding the
definition of EQUAL, to:
T.
Case 2.4.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'IF)
(NOT (EVAL$ T (CAR V) A)))
(EQUAL (EVAL$ T (CONS Z V) A)
(EVAL$ T (CADDR V) A))).
However this further simplifies, rewriting with CAR-NLISTP, and unfolding
LISTP, LITATOM, EQUAL, and EVAL$, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'IF)
(NOT (EVAL$ T W A)))
(EQUAL (EVAL$ T (CONS Z (CONS W D)) A)
(EVAL$ T (CADR D) A))).
However this further simplifies, applying the lemmas REWRITE-EVAL$,
CAR-CONS, CDR-CONS, and CDR-NLISTP, and expanding CAR, LISTP, LITATOM,
EQUAL, and EVAL$, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'IF)
(NOT (EVAL$ T W A)))
(EQUAL (EVAL$ T
(CONS Z (CONS W (CONS C V)))
A)
(EVAL$ T (CAR V) A))),
which further simplifies, applying REWRITE-EVAL$, CAR-CONS, CDR-CONS, and
CAR-NLISTP, and expanding the functions LISTP, LITATOM, EQUAL, and EVAL$,
to:
T.
Case 2.1.
(IMPLIES (AND (EQUAL Z 'IF)
(NOT (EVAL$ T W A)))
(EQUAL (EVAL$ T
(CONS Z (CONS W (CONS C (CONS D X1))))
A)
(EVAL$ T D A))).
This further simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, to:
T.
Case 1. (IMPLIES (AND (EQUAL (CAR X) 'IF)
(EVAL$ T (CADR X) A))
(EQUAL (EVAL$ T X A)
(EVAL$ T (CADDR X) A))).
Appealing to the lemma CAR-CDR-ELIM, we now replace X by (CONS Z V) to
eliminate (CAR X) and (CDR X), V by (CONS W D) to eliminate (CAR V) and
(CDR V), and D by (CONS V C) to eliminate (CAR D) and (CDR D). We must thus
prove four new goals:
Case 1.4.
(IMPLIES (AND (NOT (LISTP X))
(EQUAL (CAR X) 'IF)
(EVAL$ T (CADR X) A))
(EQUAL (EVAL$ T X A)
(EVAL$ T (CADDR X) A))),
which further simplifies, rewriting with CAR-NLISTP, and expanding the
definition of EQUAL, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (LISTP V))
(EQUAL Z 'IF)
(EVAL$ T (CAR V) A))
(EQUAL (EVAL$ T (CONS Z V) A)
(EVAL$ T (CADR V) A))).
This further simplifies, applying the lemmas CAR-NLISTP, REWRITE-EVAL$,
and CDR-NLISTP, and expanding the functions LISTP, LITATOM, EQUAL, EVAL$,
and CAR, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (LISTP D))
(EQUAL Z 'IF)
(EVAL$ T W A))
(EQUAL (EVAL$ T (CONS Z (CONS W D)) A)
(EVAL$ T (CAR D) A))),
which further simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, CDR-CONS,
and CAR-NLISTP, and unfolding the functions LISTP, LITATOM, EQUAL, and
EVAL$, to:
T.
Case 1.1.
(IMPLIES (AND (EQUAL Z 'IF) (EVAL$ T W A))
(EQUAL (EVAL$ T
(CONS Z (CONS W (CONS V C)))
A)
(EVAL$ T V A))).
This further simplifies, appealing to the lemmas REWRITE-EVAL$, CAR-CONS,
and CDR-CONS, to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
EVAL$-IF
(DISABLE EVAL$-IF)
[ 0.0 0.0 0.0 ]
EVAL$-IF-OFF
(LEMMA NUMBERP-EVAL$-TIMES-TREE
(REWRITE)
(NUMBERP (EVAL$ T (TIMES-TREE X) A))
((ENABLE TIMES-TREE)))
Call the conjecture *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP X) (p X A))
(IMPLIES (AND (NOT (NLISTP X))
(NLISTP (CDR X)))
(p X A))
(IMPLIES (AND (NOT (NLISTP X))
(NOT (NLISTP (CDR X)))
(NLISTP (CDDR X)))
(p X A))
(IMPLIES (AND (NOT (NLISTP X))
(NOT (NLISTP (CDR X)))
(NOT (NLISTP (CDDR X)))
(p (CDR X) A))
(p X A))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to establish that the measure (COUNT X) decreases according
to the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme generates the following four new formulas:
Case 4. (IMPLIES (NLISTP X)
(NUMBERP (EVAL$ T (TIMES-TREE X) A))).
This simplifies, expanding the definitions of NLISTP, TIMES-TREE, CDR, CAR,
LISTP, LITATOM, EQUAL, EVAL$, and NUMBERP, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP X))
(NLISTP (CDR X)))
(NUMBERP (EVAL$ T (TIMES-TREE X) A))).
This simplifies, appealing to the lemmas REWRITE-EVAL$ and CAR-CONS, and
opening up NLISTP, TIMES-TREE, and FIX, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP X))
(NOT (NLISTP (CDR X)))
(NLISTP (CDDR X)))
(NUMBERP (EVAL$ T (TIMES-TREE X) A))).
This simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, and CDR-CONS, and
unfolding the definitions of NLISTP and TIMES-TREE, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP X))
(NOT (NLISTP (CDR X)))
(NOT (NLISTP (CDDR X)))
(NUMBERP (EVAL$ T (TIMES-TREE (CDR X)) A)))
(NUMBERP (EVAL$ T (TIMES-TREE X) A))),
which simplifies, applying REWRITE-EVAL$, CAR-CONS, and CDR-CONS, and
expanding the functions NLISTP and TIMES-TREE, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
NUMBERP-EVAL$-TIMES-TREE
(DISABLE NUMBERP-EVAL$-TIMES-TREE)
[ 0.0 0.0 0.0 ]
NUMBERP-EVAL$-TIMES-TREE-OFF
(LEMMA LESSP-TIMES-ARG1 NIL
(IMPLIES (NOT (ZEROP A))
(EQUAL (NOT (LESSP (TIMES A X) (TIMES A Y)))
(NOT (LESSP X Y))))
((INDUCT (PLUS A X))
(ENABLE TIMES CORRECTNESS-OF-CANCEL-LESSP-PLUS)))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to two new goals:
Case 2. (IMPLIES (AND (ZEROP A)
(NOT (EQUAL A 0))
(NUMBERP A))
(EQUAL (NOT (LESSP (TIMES A X) (TIMES A Y)))
(NOT (LESSP X Y)))),
which simplifies, unfolding ZEROP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(IMPLIES (NOT (ZEROP (SUB1 A)))
(EQUAL (NOT (LESSP (TIMES (SUB1 A) X)
(TIMES (SUB1 A) Y)))
(NOT (LESSP X Y)))))
(EQUAL (NOT (LESSP (TIMES A X) (TIMES A Y)))
(NOT (LESSP X Y)))),
which simplifies, applying the lemma CORRECTNESS-OF-CANCEL-LESSP-PLUS, and
opening up the definitions of ZEROP, NOT, IMPLIES, TIMES, EQUAL, and FIX, to
eight new formulas:
Case 1.8.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(LESSP X Y)
(LESSP (TIMES (SUB1 A) X)
(TIMES (SUB1 A) Y)))
(LESSP (PLUS X (TIMES (SUB1 A) X))
(PLUS Y (TIMES (SUB1 A) Y)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (LESSP X Y))
(NOT (LESSP (TIMES (SUB1 A) X)
(TIMES (SUB1 A) Y))))
(NOT (LESSP (PLUS X (TIMES (SUB1 A) X))
(PLUS Y (TIMES (SUB1 A) Y))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (SUB1 A) 0)
(NOT (LESSP X Y))
(NUMBERP Y)
(NOT (NUMBERP X)))
(NOT (LESSP 0 Y))),
which again simplifies, expanding LESSP and NUMBERP, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (SUB1 A) 0)
(NOT (LESSP X Y))
(NOT (NUMBERP Y))
(NUMBERP X))
(NOT (LESSP X 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (SUB1 A) 0)
(NOT (LESSP X Y))
(NOT (NUMBERP Y))
(NOT (NUMBERP X)))
(NOT (LESSP 0 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (SUB1 A) 0)
(LESSP X Y)
(NUMBERP Y)
(NOT (NUMBERP X)))
(LESSP 0 Y)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (SUB1 A) 0)
(LESSP X Y)
(NOT (NUMBERP Y))
(NUMBERP X))
(LESSP X 0)),
which again simplifies, expanding the function LESSP, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (SUB1 A) 0)
(LESSP X Y)
(NOT (NUMBERP Y))
(NOT (NUMBERP X)))
(LESSP 0 0)),
which again simplifies, opening up the function LESSP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-TIMES-ARG1
(LEMMA INFER-EQUALITY-FROM-NOT-LESSP NIL
(IMPLIES (AND (NUMBERP A) (NUMBERP B))
(EQUAL (AND (NOT (LESSP A B))
(NOT (LESSP B A)))
(EQUAL A B))))
This simplifies, unfolding the definitions of NOT and AND, to the following
three new formulas:
Case 3. (IMPLIES (AND (NUMBERP A)
(NUMBERP B)
(EQUAL A B))
(NOT (LESSP B A))).
This again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NUMBERP A)
(NUMBERP B)
(EQUAL A B))
(NOT (LESSP A B))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NUMBERP A)
(NUMBERP B)
(NOT (EQUAL A B))
(NOT (LESSP A B)))
(LESSP B A)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
INFER-EQUALITY-FROM-NOT-LESSP
(LEMMA EQUAL-TIMES-ARG1
(REWRITE)
(IMPLIES (NOT (ZEROP A))
(EQUAL (EQUAL (TIMES A X) (TIMES A Y))
(EQUAL (FIX X) (FIX Y))))
((USE (LESSP-TIMES-ARG1 (A A) (X X) (Y Y))
(LESSP-TIMES-ARG1 (A A) (X Y) (Y X))
(INFER-EQUALITY-FROM-NOT-LESSP (A (TIMES A X))
(B (TIMES A Y))))
(DO-NOT-INDUCT T)))
This formula can be simplified, using the abbreviations ZEROP, NOT, IMPLIES,
and AND, to:
(IMPLIES (AND (IMPLIES (NOT (ZEROP A))
(EQUAL (NOT (LESSP (TIMES A X) (TIMES A Y)))
(NOT (LESSP X Y))))
(IMPLIES (NOT (ZEROP A))
(EQUAL (NOT (LESSP (TIMES A Y) (TIMES A X)))
(NOT (LESSP Y X))))
(IMPLIES (AND (NUMBERP (TIMES A X))
(NUMBERP (TIMES A Y)))
(EQUAL (AND (NOT (LESSP (TIMES A X) (TIMES A Y)))
(NOT (LESSP (TIMES A Y) (TIMES A X))))
(EQUAL (TIMES A X) (TIMES A Y))))
(NOT (EQUAL A 0))
(NUMBERP A))
(EQUAL (EQUAL (TIMES A X) (TIMES A Y))
(EQUAL (FIX X) (FIX Y)))),
which simplifies, expanding the functions ZEROP, NOT, IMPLIES, AND, and FIX,
to 15 new formulas:
Case 15.(IMPLIES (AND (NOT (LESSP X Y))
(NOT (LESSP (TIMES A X) (TIMES A Y)))
(NOT (LESSP Y X))
(NOT (LESSP (TIMES A Y) (TIMES A X)))
(EQUAL (TIMES A X) (TIMES A Y))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP Y))
(NUMBERP X))
(EQUAL X 0)),
which again simplifies, expanding the definition of LESSP, to:
T.
Case 14.(IMPLIES (AND (NOT (LESSP X Y))
(NOT (LESSP (TIMES A X) (TIMES A Y)))
(NOT (LESSP Y X))
(NOT (LESSP (TIMES A Y) (TIMES A X)))
(EQUAL (TIMES A X) (TIMES A Y))
(NOT (EQUAL A 0))
(NUMBERP A)
(NUMBERP Y)
(NOT (NUMBERP X)))
(EQUAL 0 Y)),
which again simplifies, opening up the definition of LESSP, to:
T.
Case 13.(IMPLIES (AND (NOT (LESSP X Y))
(NOT (LESSP (TIMES A X) (TIMES A Y)))
(NOT (LESSP Y X))
(NOT (LESSP (TIMES A Y) (TIMES A X)))
(EQUAL (TIMES A X) (TIMES A Y))
(NOT (EQUAL A 0))
(NUMBERP A)
(NUMBERP Y)
(NUMBERP X))
(EQUAL X Y)),
which again simplifies, using linear arithmetic, to:
T.
Case 12.(IMPLIES (AND (NOT (LESSP X Y))
(NOT (LESSP (TIMES A X) (TIMES A Y)))
(LESSP Y X)
(LESSP (TIMES A Y) (TIMES A X))
(NOT (EQUAL (TIMES A X) (TIMES A Y)))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP Y)))
(NOT (EQUAL X 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 11.(IMPLIES (AND (NOT (LESSP X Y))
(NOT (LESSP (TIMES A X) (TIMES A Y)))
(LESSP Y X)
(LESSP (TIMES A Y) (TIMES A X))
(NOT (EQUAL (TIMES A X) (TIMES A Y)))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP X)))
(NOT (EQUAL 0 Y))),
which again simplifies, expanding EQUAL and LESSP, to:
T.
Case 10.(IMPLIES (AND (NOT (LESSP X Y))
(NOT (LESSP (TIMES A X) (TIMES A Y)))
(LESSP Y X)
(LESSP (TIMES A Y) (TIMES A X))
(NOT (EQUAL (TIMES A X) (TIMES A Y)))
(NOT (EQUAL A 0))
(NUMBERP A)
(NUMBERP Y)
(NUMBERP X))
(NOT (EQUAL X Y))),
which again simplifies, clearly, to:
T.
Case 9. (IMPLIES (AND (NOT (LESSP X Y))
(NOT (LESSP (TIMES A X) (TIMES A Y)))
(LESSP Y X)
(LESSP (TIMES A Y) (TIMES A X))
(NOT (EQUAL (TIMES A X) (TIMES A Y)))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP Y)))
(NUMBERP X)).
However this again simplifies, unfolding the function LESSP, to:
T.
Case 8. (IMPLIES (AND (LESSP X Y)
(LESSP (TIMES A X) (TIMES A Y))
(NOT (LESSP Y X))
(NOT (LESSP (TIMES A Y) (TIMES A X)))
(NOT (EQUAL (TIMES A X) (TIMES A Y)))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP Y)))
(NOT (EQUAL X 0))),
which again simplifies, expanding LESSP, to:
T.
Case 7. (IMPLIES (AND (LESSP X Y)
(LESSP (TIMES A X) (TIMES A Y))
(NOT (LESSP Y X))
(NOT (LESSP (TIMES A Y) (TIMES A X)))
(NOT (EQUAL (TIMES A X) (TIMES A Y)))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP X)))
(NOT (EQUAL 0 Y))),
which again simplifies, using linear arithmetic, to:
T.
Case 6. (IMPLIES (AND (LESSP X Y)
(LESSP (TIMES A X) (TIMES A Y))
(NOT (LESSP Y X))
(NOT (LESSP (TIMES A Y) (TIMES A X)))
(NOT (EQUAL (TIMES A X) (TIMES A Y)))
(NOT (EQUAL A 0))
(NUMBERP A)
(NUMBERP Y)
(NUMBERP X))
(NOT (EQUAL X Y))),
which again simplifies, clearly, to:
T.
Case 5. (IMPLIES (AND (LESSP X Y)
(LESSP (TIMES A X) (TIMES A Y))
(NOT (LESSP Y X))
(NOT (LESSP (TIMES A Y) (TIMES A X)))
(NOT (EQUAL (TIMES A X) (TIMES A Y)))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP Y)))
(NUMBERP X)).
However this again simplifies, opening up LESSP, to:
T.
Case 4. (IMPLIES (AND (LESSP X Y)
(LESSP (TIMES A X) (TIMES A Y))
(LESSP Y X)
(LESSP (TIMES A Y) (TIMES A X))
(NOT (EQUAL (TIMES A X) (TIMES A Y)))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP Y)))
(NOT (EQUAL X 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (LESSP X Y)
(LESSP (TIMES A X) (TIMES A Y))
(LESSP Y X)
(LESSP (TIMES A Y) (TIMES A X))
(NOT (EQUAL (TIMES A X) (TIMES A Y)))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP X)))
(NOT (EQUAL 0 Y))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (LESSP X Y)
(LESSP (TIMES A X) (TIMES A Y))
(LESSP Y X)
(LESSP (TIMES A Y) (TIMES A X))
(NOT (EQUAL (TIMES A X) (TIMES A Y)))
(NOT (EQUAL A 0))
(NUMBERP A)
(NUMBERP Y)
(NUMBERP X))
(NOT (EQUAL X Y))),
which again simplifies, trivially, to:
T.
Case 1. (IMPLIES (AND (LESSP X Y)
(LESSP (TIMES A X) (TIMES A Y))
(LESSP Y X)
(LESSP (TIMES A Y) (TIMES A X))
(NOT (EQUAL (TIMES A X) (TIMES A Y)))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP Y)))
(NUMBERP X)).
But this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-TIMES-ARG1
(DISABLE EQUAL-TIMES-ARG1)
[ 0.0 0.0 0.0 ]
EQUAL-TIMES-ARG1-OFF
(LEMMA EQUAL-TIMES-BRIDGE
(REWRITE)
(EQUAL (EQUAL (TIMES A B)
(TIMES C (TIMES A D)))
(OR (ZEROP A)
(EQUAL (FIX B) (TIMES C D))))
((ENABLE COMMUTATIVITY-OF-TIMES COMMUTATIVITY2-OF-TIMES EQUAL-TIMES-0
EQUAL-TIMES-ARG1 TIMES-ZERO)))
This formula simplifies, rewriting with COMMUTATIVITY2-OF-TIMES, and opening
up the definitions of ZEROP, FIX, and OR, to the following six new formulas:
Case 6. (IMPLIES (NOT (EQUAL (TIMES A B) (TIMES A C D)))
(NOT (EQUAL A 0))).
But this again simplifies, using linear arithmetic, to:
T.
Case 5. (IMPLIES (NOT (EQUAL (TIMES A B) (TIMES A C D)))
(NUMBERP A)),
which again simplifies, unfolding the functions TIMES and EQUAL, to:
T.
Case 4. (IMPLIES (AND (NOT (EQUAL (TIMES A B) (TIMES A C D)))
(NUMBERP B))
(NOT (EQUAL B (TIMES C D)))),
which again simplifies, trivially, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL (TIMES A B) (TIMES A C D)))
(NOT (NUMBERP B)))
(NOT (EQUAL 0 (TIMES C D)))).
However this again simplifies, applying the lemmas TIMES-ZERO and
COMMUTATIVITY-OF-TIMES, and unfolding the functions ZEROP, EQUAL, and TIMES,
to:
T.
Case 2. (IMPLIES (AND (EQUAL (TIMES A B) (TIMES A C D))
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP B)))
(EQUAL (EQUAL 0 (TIMES C D)) T)),
which again simplifies, applying the lemmas TIMES-ZERO, EQUAL-TIMES-0, and
COMMUTATIVITY-OF-TIMES, and unfolding the functions ZEROP, EQUAL, and TIMES,
to:
T.
Case 1. (IMPLIES (AND (EQUAL (TIMES A B) (TIMES A C D))
(NOT (EQUAL A 0))
(NUMBERP A)
(NUMBERP B))
(EQUAL (EQUAL B (TIMES C D)) T)),
which again simplifies, rewriting with EQUAL-TIMES-ARG1, to:
T.
Q.E.D.
[ 0.0 0.2 0.0 ]
EQUAL-TIMES-BRIDGE
(DISABLE EQUAL-TIMES-BRIDGE)
[ 0.0 0.0 0.0 ]
EQUAL-TIMES-BRIDGE-OFF
(LEMMA EVAL$-TIMES-MEMBER
(REWRITE)
(IMPLIES (MEMBER E X)
(EQUAL (EVAL$ T (TIMES-TREE X) A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(TIMES-TREE (DELETE E X))
A))))
((ENABLE DELETE TIMES-TREE COMMUTATIVITY-OF-TIMES DELETE-NON-MEMBER
EQUAL-TIMES-0 EQUAL-TIMES-BRIDGE LISTP-DELETE MEMBER-NON-LIST
TIMES-1-ARG1 TIMES-ZERO)))
WARNING: Note that EVAL$-TIMES-MEMBER contains the free variable E which will
be chosen by instantiating the hypothesis (MEMBER E X).
Give the conjecture the name *1.
We will appeal to induction. There are four plausible inductions. They
merge into two likely candidate inductions. However, only one is unflawed.
We will induct according to the following scheme:
(AND (IMPLIES (NLISTP X) (p X A E))
(IMPLIES (AND (NOT (NLISTP X))
(EQUAL E (CAR X)))
(p X A E))
(IMPLIES (AND (NOT (NLISTP X))
(NOT (EQUAL E (CAR X)))
(p (CDR X) A E))
(p X A E))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP establish that the measure (COUNT X) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme generates the following four new formulas:
Case 4. (IMPLIES (AND (NLISTP X) (MEMBER E X))
(EQUAL (EVAL$ T (TIMES-TREE X) A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(TIMES-TREE (DELETE E X))
A)))).
This simplifies, rewriting with MEMBER-NON-LIST, and unfolding the
definition of NLISTP, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP X))
(EQUAL E (CAR X))
(MEMBER E X))
(EQUAL (EVAL$ T (TIMES-TREE X) A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(TIMES-TREE (DELETE E X))
A)))),
which simplifies, expanding NLISTP, MEMBER, TIMES-TREE, and DELETE, to three
new goals:
Case 3.3.
(IMPLIES (AND (LISTP X) (NOT (LISTP (CDR X))))
(EQUAL (EVAL$ T (LIST 'FIX (CAR X)) A)
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))),
which again simplifies, applying REWRITE-EVAL$ and CAR-CONS, and opening
up FIX, to the following two new formulas:
Case 3.3.2.
(IMPLIES (AND (LISTP X)
(NOT (LISTP (CDR X)))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL 0
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))).
However this again simplifies, expanding the functions TIMES and EQUAL,
to:
T.
Case 3.3.1.
(IMPLIES (AND (LISTP X)
(NOT (LISTP (CDR X)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T (CAR X) A)
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))),
which further simplifies, applying the lemmas TIMES-1-ARG1 and
COMMUTATIVITY-OF-TIMES, and expanding the functions TIMES-TREE, CDR, CAR,
LISTP, LITATOM, EQUAL, and EVAL$, to:
T.
Case 3.2.
(IMPLIES (AND (LISTP X)
(LISTP (CDR X))
(LISTP (CDDR X)))
(EQUAL (EVAL$ T
(LIST 'TIMES
(CAR X)
(TIMES-TREE (CDR X)))
A)
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))),
which again simplifies, appealing to the lemmas REWRITE-EVAL$, CAR-CONS,
and CDR-CONS, to:
T.
Case 3.1.
(IMPLIES (AND (LISTP X)
(LISTP (CDR X))
(NOT (LISTP (CDDR X))))
(EQUAL (EVAL$ T
(LIST 'TIMES (CAR X) (CADR X))
A)
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))),
which again simplifies, applying REWRITE-EVAL$, CAR-CONS, and CDR-CONS, to
the new conjecture:
(IMPLIES (AND (LISTP X)
(LISTP (CDR X))
(NOT (LISTP (CDDR X))))
(EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (CADR X) A))
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))),
which further simplifies, rewriting with REWRITE-EVAL$ and CAR-CONS, and
opening up TIMES-TREE and FIX, to:
(IMPLIES (AND (LISTP X)
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (NUMBERP (EVAL$ T (CADR X) A))))
(EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (CADR X) A))
(TIMES (EVAL$ T (CAR X) A) 0))),
which again simplifies, rewriting with TIMES-ZERO and
COMMUTATIVITY-OF-TIMES, and expanding the definitions of ZEROP, EQUAL, and
TIMES, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP X))
(NOT (EQUAL E (CAR X)))
(NOT (MEMBER E (CDR X)))
(MEMBER E X))
(EQUAL (EVAL$ T (TIMES-TREE X) A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(TIMES-TREE (DELETE E X))
A)))).
This simplifies, expanding the definitions of NLISTP and MEMBER, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP X))
(NOT (EQUAL E (CAR X)))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(TIMES-TREE (DELETE E (CDR X)))
A)))
(MEMBER E X))
(EQUAL (EVAL$ T (TIMES-TREE X) A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(TIMES-TREE (DELETE E X))
A)))).
This simplifies, appealing to the lemmas CAR-CONS, LISTP-DELETE, and
CDR-CONS, and unfolding NLISTP, MEMBER, TIMES-TREE, and DELETE, to the
following six new formulas:
Case 1.6.
(IMPLIES (AND (LISTP X)
(NOT (EQUAL E (CAR X)))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(TIMES-TREE (DELETE E (CDR X)))
A)))
(MEMBER E (CDR X))
(LISTP (CDR X))
(LISTP (CDDR X))
(LISTP (CDR (DELETE E (CDR X)))))
(EQUAL (EVAL$ T
(LIST 'TIMES
(CAR X)
(TIMES-TREE (CDR X)))
A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(LIST 'TIMES
(CAR X)
(TIMES-TREE (DELETE E (CDR X))))
A)))).
This again simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, CDR-CONS,
and EQUAL-TIMES-BRIDGE, to:
T.
Case 1.5.
(IMPLIES (AND (LISTP X)
(NOT (EQUAL E (CAR X)))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(TIMES-TREE (DELETE E (CDR X)))
A)))
(MEMBER E (CDR X))
(LISTP (CDR X))
(NOT (EQUAL E (CADR X)))
(LISTP (CDR (DELETE E (CDR X))))
(NOT (LISTP (CDDR X))))
(EQUAL (EVAL$ T
(LIST 'TIMES (CAR X) (CADR X))
A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(LIST 'TIMES
(CAR X)
(TIMES-TREE (DELETE E (CDR X))))
A)))).
However this again simplifies, rewriting with the lemmas REWRITE-EVAL$,
CAR-CONS, CDR-CONS, and EQUAL-TIMES-BRIDGE, to two new conjectures:
Case 1.5.2.
(IMPLIES (AND (LISTP X)
(NOT (EQUAL E (CAR X)))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(TIMES-TREE (DELETE E (CDR X)))
A)))
(MEMBER E (CDR X))
(LISTP (CDR X))
(NOT (EQUAL E (CADR X)))
(LISTP (CDR (DELETE E (CDR X))))
(NOT (LISTP (CDDR X)))
(NOT (EQUAL (EVAL$ T (CAR X) A) 0))
(NUMBERP (EVAL$ T (CAR X) A))
(NOT (NUMBERP (EVAL$ T (CADR X) A))))
(EQUAL 0
(EVAL$ T (TIMES-TREE (CDR X)) A))),
which further simplifies, rewriting with REWRITE-EVAL$, CAR-CONS,
CONS-CAR-CDR, DELETE-NON-MEMBER, MEMBER-NON-LIST, and
COMMUTATIVITY-OF-TIMES, and expanding TIMES-TREE, FIX, DELETE, EQUAL,
TIMES, and MEMBER, to:
T.
Case 1.5.1.
(IMPLIES (AND (LISTP X)
(NOT (EQUAL E (CAR X)))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(TIMES-TREE (DELETE E (CDR X)))
A)))
(MEMBER E (CDR X))
(LISTP (CDR X))
(NOT (EQUAL E (CADR X)))
(LISTP (CDR (DELETE E (CDR X))))
(NOT (LISTP (CDDR X)))
(NOT (EQUAL (EVAL$ T (CAR X) A) 0))
(NUMBERP (EVAL$ T (CAR X) A))
(NUMBERP (EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T (CADR X) A)
(EVAL$ T (TIMES-TREE (CDR X)) A))).
However this further simplifies, rewriting with the lemmas REWRITE-EVAL$,
CAR-CONS, CONS-CAR-CDR, DELETE-NON-MEMBER, and MEMBER-NON-LIST, and
opening up the definitions of TIMES-TREE, FIX, DELETE, and MEMBER, to:
T.
Case 1.4.
(IMPLIES (AND (LISTP X)
(NOT (EQUAL E (CAR X)))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(TIMES-TREE (DELETE E (CDR X)))
A)))
(MEMBER E (CDR X))
(LISTP (CDR X))
(LISTP (CDDR X))
(NOT (LISTP (CDR (DELETE E (CDR X))))))
(EQUAL (EVAL$ T
(LIST 'TIMES
(CAR X)
(TIMES-TREE (CDR X)))
A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(LIST 'TIMES
(CAR X)
(CAR (DELETE E (CDR X))))
A)))),
which again simplifies, appealing to the lemmas LISTP-DELETE,
REWRITE-EVAL$, CAR-CONS, CDR-CONS, TIMES-ZERO, COMMUTATIVITY-OF-TIMES,
EQUAL-TIMES-0, and EQUAL-TIMES-BRIDGE, and opening up the functions
TIMES-TREE, FIX, ZEROP, EQUAL, and TIMES, to the formula:
(IMPLIES (AND (LISTP X)
(NOT (EQUAL E (CAR X)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE E (CDR X))) A)))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(TIMES (EVAL$ T E A) 0))
(MEMBER E (CDR X))
(LISTP (CDR X))
(LISTP (CDDR X))
(NOT (LISTP (CDR (DELETE E (CDR X)))))
(NOT (EQUAL (EVAL$ T (CAR X) A) 0))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
0)).
But this again simplifies, rewriting with the lemma COMMUTATIVITY-OF-TIMES,
and expanding the definitions of EQUAL and TIMES, to:
T.
Case 1.3.
(IMPLIES (AND (LISTP X)
(NOT (EQUAL E (CAR X)))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(TIMES-TREE (DELETE E (CDR X)))
A)))
(MEMBER E (CDR X))
(LISTP (CDR X))
(NOT (EQUAL E (CADR X)))
(NOT (LISTP (CDR (DELETE E (CDR X)))))
(NOT (LISTP (CDDR X))))
(EQUAL (EVAL$ T
(LIST 'TIMES (CAR X) (CADR X))
A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(LIST 'TIMES
(CAR X)
(CAR (DELETE E (CDR X))))
A)))),
which again simplifies, applying LISTP-DELETE, REWRITE-EVAL$, CAR-CONS,
CDR-CONS, TIMES-ZERO, COMMUTATIVITY-OF-TIMES, EQUAL-TIMES-0, and
EQUAL-TIMES-BRIDGE, and unfolding the functions TIMES-TREE, FIX, ZEROP,
EQUAL, and TIMES, to the following three new conjectures:
Case 1.3.3.
(IMPLIES (AND (LISTP X)
(NOT (EQUAL E (CAR X)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE E (CDR X))) A)))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(TIMES (EVAL$ T E A) 0))
(MEMBER E (CDR X))
(LISTP (CDR X))
(NOT (EQUAL E (CADR X)))
(NOT (LISTP (CDR (DELETE E (CDR X)))))
(NOT (LISTP (CDDR X)))
(NOT (EQUAL (EVAL$ T (CAR X) A) 0))
(NUMBERP (EVAL$ T (CAR X) A))
(NOT (EQUAL (EVAL$ T (CADR X) A) 0)))
(NOT (NUMBERP (EVAL$ T (CADR X) A)))).
This again simplifies, rewriting with COMMUTATIVITY-OF-TIMES, and
unfolding the functions EQUAL and TIMES, to:
(IMPLIES (AND (LISTP X)
(NOT (EQUAL E (CAR X)))
(NOT (NUMBERP (EVAL$ T (CAR (DELETE E (CDR X))) A)))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
0)
(MEMBER E (CDR X))
(LISTP (CDR X))
(NOT (EQUAL E (CADR X)))
(NOT (LISTP (CDR (DELETE E (CDR X)))))
(NOT (LISTP (CDDR X)))
(NOT (EQUAL (EVAL$ T (CAR X) A) 0))
(NUMBERP (EVAL$ T (CAR X) A))
(NOT (EQUAL (EVAL$ T (CADR X) A) 0)))
(NOT (NUMBERP (EVAL$ T (CADR X) A)))),
which further simplifies, applying the lemmas CONS-CAR-CDR,
DELETE-NON-MEMBER, and MEMBER-NON-LIST, and expanding DELETE, to:
T.
Case 1.3.2.
(IMPLIES (AND (LISTP X)
(NOT (EQUAL E (CAR X)))
(NUMBERP (EVAL$ T (CAR (DELETE E (CDR X))) A))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(TIMES (EVAL$ T E A)
(EVAL$ T (CAR (DELETE E (CDR X))) A)))
(MEMBER E (CDR X))
(LISTP (CDR X))
(NOT (EQUAL E (CADR X)))
(NOT (LISTP (CDR (DELETE E (CDR X)))))
(NOT (LISTP (CDDR X)))
(NOT (EQUAL (EVAL$ T (CAR X) A) 0))
(NUMBERP (EVAL$ T (CAR X) A))
(NOT (NUMBERP (EVAL$ T (CADR X) A))))
(EQUAL 0
(EVAL$ T (TIMES-TREE (CDR X)) A))),
which further simplifies, applying CONS-CAR-CDR, DELETE-NON-MEMBER, and
MEMBER-NON-LIST, and expanding the function DELETE, to:
T.
Case 1.3.1.
(IMPLIES (AND (LISTP X)
(NOT (EQUAL E (CAR X)))
(NUMBERP (EVAL$ T (CAR (DELETE E (CDR X))) A))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(TIMES (EVAL$ T E A)
(EVAL$ T (CAR (DELETE E (CDR X))) A)))
(MEMBER E (CDR X))
(LISTP (CDR X))
(NOT (EQUAL E (CADR X)))
(NOT (LISTP (CDR (DELETE E (CDR X)))))
(NOT (LISTP (CDDR X)))
(NOT (EQUAL (EVAL$ T (CAR X) A) 0))
(NUMBERP (EVAL$ T (CAR X) A))
(NUMBERP (EVAL$ T (CADR X) A)))
(EQUAL (EVAL$ T (CADR X) A)
(EVAL$ T (TIMES-TREE (CDR X)) A))).
This further simplifies, applying CONS-CAR-CDR, DELETE-NON-MEMBER,
MEMBER-NON-LIST, REWRITE-EVAL$, and CAR-CONS, and expanding the
functions DELETE, TIMES-TREE, FIX, and MEMBER, to:
T.
Case 1.2.
(IMPLIES (AND (LISTP X)
(NOT (EQUAL E (CAR X)))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(TIMES-TREE (DELETE E (CDR X)))
A)))
(MEMBER E (CDR X))
(LISTP (CDR X))
(EQUAL E (CADR X))
(NOT (LISTP (CDDR X))))
(EQUAL (EVAL$ T
(LIST 'TIMES (CAR X) (CADR X))
A)
(TIMES (EVAL$ T E A)
(EVAL$ T (LIST 'FIX (CAR X)) A)))).
But this again simplifies, applying TIMES-1-ARG1, COMMUTATIVITY-OF-TIMES,
REWRITE-EVAL$, CAR-CONS, CDR-CONS, and TIMES-ZERO, and opening up the
definitions of DELETE, TIMES-TREE, CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$,
MEMBER, ZEROP, FIX, and TIMES, to the following two new conjectures:
Case 1.2.2.
(IMPLIES (AND (LISTP X)
(NOT (EQUAL (CADR X) (CAR X)))
(NUMBERP (EVAL$ T (CADR X) A))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(EVAL$ T (CADR X) A))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (CADR X) A))
(TIMES (EVAL$ T (CADR X) A) 0))).
But this again simplifies, rewriting with COMMUTATIVITY-OF-TIMES, and
expanding TIMES and EQUAL, to:
T.
Case 1.2.1.
(IMPLIES (AND (LISTP X)
(NOT (EQUAL (CADR X) (CAR X)))
(NUMBERP (EVAL$ T (CADR X) A))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(EVAL$ T (CADR X) A))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (CADR X) A))
(TIMES (EVAL$ T (CADR X) A)
(EVAL$ T (CAR X) A)))).
This again simplifies, appealing to the lemma COMMUTATIVITY-OF-TIMES, to:
T.
Case 1.1.
(IMPLIES (AND (LISTP X)
(NOT (EQUAL E (CAR X)))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(TIMES (EVAL$ T E A)
(EVAL$ T
(TIMES-TREE (DELETE E (CDR X)))
A)))
(MEMBER E (CDR X))
(NOT (LISTP (CDR X))))
(EQUAL (EVAL$ T (LIST 'FIX (CAR X)) A)
(TIMES (EVAL$ T E A)
(EVAL$ T (LIST 'FIX (CAR X)) A)))),
which again simplifies, appealing to the lemmas LISTP-DELETE, TIMES-1-ARG1,
COMMUTATIVITY-OF-TIMES, REWRITE-EVAL$, and CAR-CONS, and unfolding
TIMES-TREE, CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$, FIX, and TIMES, to
three new formulas:
Case 1.1.3.
(IMPLIES (AND (LISTP X)
(NOT (EQUAL E (CAR X)))
(NOT (NUMBERP (EVAL$ T E A)))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
0)
(MEMBER E (CDR X))
(NOT (LISTP (CDR X)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T (CAR X) A) 0)),
which further simplifies, expanding TIMES-TREE, CDR, CAR, LISTP, LITATOM,
EQUAL, and EVAL$, to:
T.
Case 1.1.2.
(IMPLIES (AND (LISTP X)
(NOT (EQUAL E (CAR X)))
(NUMBERP (EVAL$ T E A))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(EVAL$ T E A))
(MEMBER E (CDR X))
(NOT (LISTP (CDR X)))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL 0 (TIMES (EVAL$ T E A) 0))),
which again simplifies, applying COMMUTATIVITY-OF-TIMES, and expanding
the functions EQUAL and TIMES, to:
T.
Case 1.1.1.
(IMPLIES (AND (LISTP X)
(NOT (EQUAL E (CAR X)))
(NUMBERP (EVAL$ T E A))
(EQUAL (EVAL$ T (TIMES-TREE (CDR X)) A)
(EVAL$ T E A))
(MEMBER E (CDR X))
(NOT (LISTP (CDR X)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T (CAR X) A)
(TIMES (EVAL$ T E A)
(EVAL$ T (CAR X) A)))).
But this further simplifies, applying the lemma MEMBER-NON-LIST, and
unfolding TIMES-TREE, CDR, CAR, LISTP, LITATOM, EQUAL, and EVAL$, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 3.6 0.1 ]
EVAL$-TIMES-MEMBER
(DISABLE EVAL$-TIMES-MEMBER)
[ 0.0 0.0 0.0 ]
EVAL$-TIMES-MEMBER-OFF
(LEMMA ZEROP-MAKES-TIMES-TREE-ZERO
(REWRITE)
(IMPLIES (AND (NOT (EVAL$ T (AND-NOT-ZEROP-TREE X) A))
(SUBBAGP X Y))
(EQUAL (EVAL$ T (TIMES-TREE Y) A) 0))
((ENABLE AND-NOT-ZEROP-TREE COMMUTATIVITY-OF-TIMES EVAL$-TIMES-MEMBER
SUBBAGP TIMES-TREE TIMES-ZERO)))
WARNING: Note that ZEROP-MAKES-TIMES-TREE-ZERO contains the free variable X
which will be chosen by instantiating the hypothesis:
(NOT (EVAL$ T (AND-NOT-ZEROP-TREE X) A)).
Call the conjecture *1.
Let us appeal to the induction principle. Three inductions are suggested
by terms in the conjecture. They merge into two likely candidate inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (NLISTP X) (p Y A X))
(IMPLIES (AND (NOT (NLISTP X))
(NLISTP (CDR X)))
(p Y A X))
(IMPLIES (AND (NOT (NLISTP X))
(NOT (NLISTP (CDR X)))
(p (DELETE (CAR X) Y) A (CDR X)))
(p Y A X))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP establish that the measure (COUNT X) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for Y. The above induction scheme
produces five new goals:
Case 5. (IMPLIES (AND (NLISTP X)
(NOT (EVAL$ T (AND-NOT-ZEROP-TREE X) A))
(SUBBAGP X Y))
(EQUAL (EVAL$ T (TIMES-TREE Y) A) 0)),
which simplifies, rewriting with REWRITE-EVAL$, and opening up the
definitions of NLISTP and AND-NOT-ZEROP-TREE, to:
T.
Case 4. (IMPLIES (AND (NOT (NLISTP X))
(NLISTP (CDR X))
(NOT (EVAL$ T (AND-NOT-ZEROP-TREE X) A))
(SUBBAGP X Y))
(EQUAL (EVAL$ T (TIMES-TREE Y) A) 0)).
This simplifies, applying the lemmas REWRITE-EVAL$, CAR-CONS, and
EVAL$-TIMES-MEMBER, and unfolding the functions NLISTP, AND-NOT-ZEROP-TREE,
ZEROP, NOT, SUBBAGP, EQUAL, and TIMES, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP X))
(NOT (NLISTP (CDR X)))
(EVAL$ T
(AND-NOT-ZEROP-TREE (CDR X))
A)
(NOT (EVAL$ T (AND-NOT-ZEROP-TREE X) A))
(SUBBAGP X Y))
(EQUAL (EVAL$ T (TIMES-TREE Y) A) 0)).
This simplifies, appealing to the lemmas REWRITE-EVAL$, CAR-CONS, CDR-CONS,
and EVAL$-TIMES-MEMBER, and expanding the functions NLISTP,
AND-NOT-ZEROP-TREE, ZEROP, NOT, AND, SUBBAGP, EQUAL, and TIMES, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP X))
(NOT (NLISTP (CDR X)))
(NOT (SUBBAGP (CDR X) (DELETE (CAR X) Y)))
(NOT (EVAL$ T (AND-NOT-ZEROP-TREE X) A))
(SUBBAGP X Y))
(EQUAL (EVAL$ T (TIMES-TREE Y) A) 0)).
This simplifies, rewriting with the lemmas REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, and opening up the functions NLISTP, AND-NOT-ZEROP-TREE, ZEROP,
NOT, AND, and SUBBAGP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP X))
(NOT (NLISTP (CDR X)))
(EQUAL (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
0)
(NOT (EVAL$ T (AND-NOT-ZEROP-TREE X) A))
(SUBBAGP X Y))
(EQUAL (EVAL$ T (TIMES-TREE Y) A) 0)).
This simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, CDR-CONS,
EVAL$-TIMES-MEMBER, TIMES-ZERO, and COMMUTATIVITY-OF-TIMES, and unfolding
the definitions of NLISTP, AND-NOT-ZEROP-TREE, ZEROP, NOT, AND, SUBBAGP,
TIMES, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.4 0.0 ]
ZEROP-MAKES-TIMES-TREE-ZERO
(DISABLE ZEROP-MAKES-TIMES-TREE-ZERO)
[ 0.0 0.0 0.0 ]
ZEROP-MAKES-TIMES-TREE-ZERO-OFF
(LEMMA OR-ZEROP-TREE-IS-NOT-ZEROP-TREE
(REWRITE)
(EQUAL (EVAL$ T (OR-ZEROP-TREE X) A)
(NOT (EVAL$ T (AND-NOT-ZEROP-TREE X) A)))
((ENABLE AND-NOT-ZEROP-TREE OR-ZEROP-TREE)))
This simplifies, unfolding the function NOT, to the following two new formulas:
Case 2. (IMPLIES (NOT (EVAL$ T (AND-NOT-ZEROP-TREE X) A))
(EQUAL (EVAL$ T (OR-ZEROP-TREE X) A)
T)).
Give the above formula the name *1.
Case 1. (IMPLIES (EVAL$ T (AND-NOT-ZEROP-TREE X) A)
(EQUAL (EVAL$ T (OR-ZEROP-TREE X) A)
F)).
This again simplifies, clearly, to:
(IMPLIES (EVAL$ T (AND-NOT-ZEROP-TREE X) A)
(NOT (EVAL$ T (OR-ZEROP-TREE X) A))),
which we would normally push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us return to:
(EQUAL (EVAL$ T (OR-ZEROP-TREE X) A)
(NOT (EVAL$ T (AND-NOT-ZEROP-TREE X) A))).
We named this *1. We will try to prove it by induction. Two inductions are
suggested by terms in the conjecture. However, they merge into one likely
candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP X) (p X A))
(IMPLIES (AND (NOT (NLISTP X))
(NLISTP (CDR X)))
(p X A))
(IMPLIES (AND (NOT (NLISTP X))
(NOT (NLISTP (CDR X)))
(NLISTP (CDDR X)))
(p X A))
(IMPLIES (AND (NOT (NLISTP X))
(NOT (NLISTP (CDR X)))
(NOT (NLISTP (CDDR X)))
(p (CDR X) A))
(p X A))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT X) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme generates four new conjectures:
Case 4. (IMPLIES (NLISTP X)
(EQUAL (EVAL$ T (OR-ZEROP-TREE X) A)
(NOT (EVAL$ T (AND-NOT-ZEROP-TREE X) A)))),
which simplifies, applying REWRITE-EVAL$, and expanding the functions NLISTP,
OR-ZEROP-TREE, AND-NOT-ZEROP-TREE, NOT, and EQUAL, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP X))
(NLISTP (CDR X)))
(EQUAL (EVAL$ T (OR-ZEROP-TREE X) A)
(NOT (EVAL$ T (AND-NOT-ZEROP-TREE X) A)))).
This simplifies, appealing to the lemmas REWRITE-EVAL$ and CAR-CONS, and
expanding the functions NLISTP, OR-ZEROP-TREE, ZEROP, AND-NOT-ZEROP-TREE,
and NOT, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP X))
(NOT (NLISTP (CDR X)))
(NLISTP (CDDR X)))
(EQUAL (EVAL$ T (OR-ZEROP-TREE X) A)
(NOT (EVAL$ T (AND-NOT-ZEROP-TREE X) A)))).
This simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, and CDR-CONS, and
expanding NLISTP, OR-ZEROP-TREE, ZEROP, OR, AND-NOT-ZEROP-TREE, NOT, and AND,
to three new goals:
Case 2.3.
(IMPLIES (AND (LISTP X)
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (EQUAL (EVAL$ T (CAR X) A) 0))
(NUMBERP (EVAL$ T (CAR X) A))
(NOT (EVAL$ T
(AND-NOT-ZEROP-TREE (CDR X))
A))
(NOT (EQUAL (EVAL$ T (CADR X) A) 0)))
(NOT (NUMBERP (EVAL$ T (CADR X) A)))),
which further simplifies, applying REWRITE-EVAL$ and CAR-CONS, and
unfolding the functions AND-NOT-ZEROP-TREE, ZEROP, and NOT, to:
T.
Case 2.2.
(IMPLIES (AND (LISTP X)
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (EQUAL (EVAL$ T (CAR X) A) 0))
(NUMBERP (EVAL$ T (CAR X) A))
(EVAL$ T
(AND-NOT-ZEROP-TREE (CDR X))
A))
(NOT (EQUAL (EVAL$ T (CADR X) A) 0))).
This further simplifies, rewriting with REWRITE-EVAL$ and CAR-CONS, and
unfolding the definitions of AND-NOT-ZEROP-TREE, ZEROP, and NOT, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP X)
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (EQUAL (EVAL$ T (CAR X) A) 0))
(NUMBERP (EVAL$ T (CAR X) A))
(EVAL$ T
(AND-NOT-ZEROP-TREE (CDR X))
A))
(NUMBERP (EVAL$ T (CADR X) A))).
However this further simplifies, applying REWRITE-EVAL$ and CAR-CONS, and
expanding AND-NOT-ZEROP-TREE, ZEROP, and NOT, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP X))
(NOT (NLISTP (CDR X)))
(NOT (NLISTP (CDDR X)))
(EQUAL (EVAL$ T (OR-ZEROP-TREE (CDR X)) A)
(NOT (EVAL$ T
(AND-NOT-ZEROP-TREE (CDR X))
A))))
(EQUAL (EVAL$ T (OR-ZEROP-TREE X) A)
(NOT (EVAL$ T (AND-NOT-ZEROP-TREE X) A)))).
This simplifies, applying REWRITE-EVAL$, CAR-CONS, and CDR-CONS, and
expanding the definitions of NLISTP, NOT, OR-ZEROP-TREE, ZEROP, OR,
AND-NOT-ZEROP-TREE, AND, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.6 0.1 ]
OR-ZEROP-TREE-IS-NOT-ZEROP-TREE
(DISABLE OR-ZEROP-TREE-IS-NOT-ZEROP-TREE)
[ 0.0 0.0 0.0 ]
OR-ZEROP-TREE-IS-NOT-ZEROP-TREE-OFF
(LEMMA ZEROP-MAKES-TIMES-TREE-ZERO2
(REWRITE)
(IMPLIES (AND (EVAL$ T (OR-ZEROP-TREE X) A)
(SUBBAGP X Y))
(EQUAL (EVAL$ T (TIMES-TREE Y) A) 0))
((USE (ZEROP-MAKES-TIMES-TREE-ZERO)
(OR-ZEROP-TREE-IS-NOT-ZEROP-TREE))
(ENABLE OR-ZEROP-TREE SUBBAGP TIMES-TREE)))
WARNING: Note that ZEROP-MAKES-TIMES-TREE-ZERO2 contains the free variable X
which will be chosen by instantiating the hypothesis:
(EVAL$ T (OR-ZEROP-TREE X) A).
This formula simplifies, unfolding the definitions of NOT, AND, and IMPLIES,
to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
ZEROP-MAKES-TIMES-TREE-ZERO2
(DISABLE ZEROP-MAKES-TIMES-TREE-ZERO2)
[ 0.0 0.0 0.0 ]
ZEROP-MAKES-TIMES-TREE-ZERO2-OFF
(LEMMA TIMES-TREE-APPEND
(REWRITE)
(EQUAL (EVAL$ T (TIMES-TREE (APPEND X Y)) A)
(TIMES (EVAL$ T (TIMES-TREE X) A)
(EVAL$ T (TIMES-TREE Y) A)))
((ENABLE APPEND ASSOCIATIVITY-OF-TIMES COMMUTATIVITY-OF-TIMES
COMMUTATIVITY2-OF-TIMES EQUAL-TIMES-0 EQUAL-TIMES-ARG1
EQUAL-TIMES-BRIDGE NUMBERP-EVAL$-TIMES-TREE TIMES-1-ARG1
TIMES-TREE TIMES-ZERO)))
Name the conjecture *1.
We will appeal to induction. The recursive terms in the conjecture
suggest three inductions. They merge into two likely candidate inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LISTP X) (p (CDR X) Y A))
(p X Y A))
(IMPLIES (NOT (LISTP X)) (p X Y A))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme generates the following two new
conjectures:
Case 2. (IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A)
(TIMES (EVAL$ T (TIMES-TREE (CDR X)) A)
(EVAL$ T (TIMES-TREE Y) A))))
(EQUAL (EVAL$ T (TIMES-TREE (APPEND X Y)) A)
(TIMES (EVAL$ T (TIMES-TREE X) A)
(EVAL$ T (TIMES-TREE Y) A)))).
This simplifies, rewriting with COMMUTATIVITY-OF-TIMES, CAR-CONS, and
CDR-CONS, and expanding APPEND and TIMES-TREE, to nine new formulas:
Case 2.9.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(NOT (LISTP (APPEND (CDR X) Y))))
(EQUAL (EVAL$ T (LIST 'FIX (CAR X)) A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (LIST 'FIX (CAR X)) A)))),
which again simplifies, appealing to the lemmas REWRITE-EVAL$ and CAR-CONS,
and expanding the definitions of TIMES-TREE, CDR, CAR, LISTP, LITATOM,
EQUAL, EVAL$, and FIX, to two new goals:
Case 2.9.2.
(IMPLIES (AND (LISTP X)
(EQUAL 1
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(NOT (LISTP (APPEND (CDR X) Y)))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL 0
(TIMES (EVAL$ T (TIMES-TREE Y) A)
0))),
which again simplifies, applying COMMUTATIVITY-OF-TIMES, and opening up
the functions EQUAL and TIMES, to:
T.
Case 2.9.1.
(IMPLIES (AND (LISTP X)
(EQUAL 1
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(NOT (LISTP (APPEND (CDR X) Y)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T (CAR X) A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (CAR X) A)))).
This again simplifies, applying COMMUTATIVITY-OF-TIMES, to the new
formula:
(IMPLIES (AND (LISTP X)
(EQUAL 1
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(NOT (LISTP (APPEND (CDR X) Y)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T (CAR X) A)
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (TIMES-TREE Y) A)))),
which further simplifies, appealing to the lemmas
NUMBERP-EVAL$-TIMES-TREE, TIMES-1-ARG1, and COMMUTATIVITY-OF-TIMES, and
expanding TIMES-TREE, CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$, and APPEND,
to:
T.
Case 2.8.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(LISTP (CDR (APPEND (CDR X) Y))))
(EQUAL (EVAL$ T
(LIST 'TIMES
(CAR X)
(TIMES-TREE (APPEND (CDR X) Y)))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (LIST 'FIX (CAR X)) A)))),
which again simplifies, applying REWRITE-EVAL$, CAR-CONS, and CDR-CONS,
and opening up FIX, to the following two new formulas:
Case 2.8.2.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(LISTP (CDR (APPEND (CDR X) Y)))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A))
(TIMES (EVAL$ T (TIMES-TREE Y) A)
0))).
However this again simplifies, rewriting with COMMUTATIVITY-OF-TIMES,
and opening up TIMES and EQUAL, to:
T.
Case 2.8.1.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(LISTP (CDR (APPEND (CDR X) Y)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A))
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (CAR X) A)))).
However this again simplifies, applying COMMUTATIVITY-OF-TIMES, to the
new conjecture:
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(LISTP (CDR (APPEND (CDR X) Y)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A))
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (TIMES-TREE Y) A)))),
which further simplifies, rewriting with the lemmas
NUMBERP-EVAL$-TIMES-TREE, TIMES-1-ARG1, and COMMUTATIVITY-OF-TIMES, and
opening up the functions APPEND, TIMES-TREE, CDR, CAR, LISTP, LITATOM,
EQUAL, and EVAL$, to:
T.
Case 2.7.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y)))))
(EQUAL (EVAL$ T
(LIST 'TIMES
(CAR X)
(CAR (APPEND (CDR X) Y)))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (LIST 'FIX (CAR X)) A)))),
which again simplifies, applying REWRITE-EVAL$, CAR-CONS, CDR-CONS,
TIMES-ZERO, NUMBERP-EVAL$-TIMES-TREE, and EQUAL-TIMES-0, and opening up
the functions TIMES-TREE, FIX, and ZEROP, to the following three new goals:
Case 2.7.3.
(IMPLIES (AND (LISTP X)
(NOT (NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A)))
(EQUAL 0
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NOT (EQUAL 0 (EVAL$ T (TIMES-TREE Y) A)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL 0 (EVAL$ T (CAR X) A))).
This again simplifies, rewriting with NUMBERP-EVAL$-TIMES-TREE and
EQUAL-TIMES-0, to the new formula:
(IMPLIES (AND (LISTP X)
(NOT (NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A)))
(EQUAL 0
(EVAL$ T (TIMES-TREE (CDR X)) A))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NOT (EQUAL 0 (EVAL$ T (TIMES-TREE Y) A)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL 0 (EVAL$ T (CAR X) A))),
which further simplifies, opening up the functions APPEND, TIMES-TREE,
CDR, CAR, LISTP, LITATOM, EQUAL, and EVAL$, to:
T.
Case 2.7.2.
(IMPLIES (AND (LISTP X)
(NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A))
(EQUAL (EVAL$ T (CAR (APPEND (CDR X) Y)) A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (CAR (APPEND (CDR X) Y)) A))
(TIMES (EVAL$ T (TIMES-TREE Y) A)
0))),
which again simplifies, applying the lemma COMMUTATIVITY-OF-TIMES, and
unfolding the functions TIMES and EQUAL, to:
T.
Case 2.7.1.
(IMPLIES (AND (LISTP X)
(NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A))
(EQUAL (EVAL$ T (CAR (APPEND (CDR X) Y)) A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (CAR (APPEND (CDR X) Y)) A))
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (CAR X) A)))),
which again simplifies, rewriting with COMMUTATIVITY-OF-TIMES, to:
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T (CAR (APPEND (CDR X) Y)) A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(NOT (LISTP (CDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (CAR (APPEND (CDR X) Y)) A))
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (TIMES-TREE Y) A)))),
which further simplifies, rewriting with NUMBERP-EVAL$-TIMES-TREE,
TIMES-1-ARG1, COMMUTATIVITY-OF-TIMES, REWRITE-EVAL$, and CAR-CONS, and
opening up APPEND, TIMES-TREE, CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$,
and FIX, to:
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T (CAR Y) A)
(EVAL$ T (TIMES-TREE Y) A))
(NOT (LISTP (CDR X)))
(LISTP Y)
(NOT (LISTP (CDR Y)))
(NUMBERP (EVAL$ T (CAR X) A))
(NOT (NUMBERP (EVAL$ T (CAR Y) A))))
(EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (CAR Y) A))
(TIMES (EVAL$ T (CAR X) A) 0))),
which again simplifies, applying the lemmas REWRITE-EVAL$ and CAR-CONS,
and unfolding the definitions of TIMES-TREE and FIX, to:
T.
Case 2.6.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(LISTP (CDR X))
(LISTP (CDDR X))
(NOT (LISTP (APPEND (CDR X) Y))))
(EQUAL (EVAL$ T (LIST 'FIX (CAR X)) A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T
(LIST 'TIMES
(CAR X)
(TIMES-TREE (CDR X)))
A)))),
which again simplifies, applying REWRITE-EVAL$, CAR-CONS, CDR-CONS,
TIMES-1-ARG1, COMMUTATIVITY-OF-TIMES, and COMMUTATIVITY2-OF-TIMES, and
opening up TIMES-TREE, CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$, and FIX, to:
T.
Case 2.5.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(LISTP (CDR X))
(LISTP (CDDR X))
(LISTP (APPEND (CDR X) Y))
(LISTP (CDR (APPEND (CDR X) Y))))
(EQUAL (EVAL$ T
(LIST 'TIMES
(CAR X)
(TIMES-TREE (APPEND (CDR X) Y)))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T
(LIST 'TIMES
(CAR X)
(TIMES-TREE (CDR X)))
A)))).
However this again simplifies, rewriting with the lemmas REWRITE-EVAL$,
CAR-CONS, CDR-CONS, and COMMUTATIVITY2-OF-TIMES, to:
T.
Case 2.4.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(LISTP (CDR X))
(LISTP (CDDR X))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y)))))
(EQUAL (EVAL$ T
(LIST 'TIMES
(CAR X)
(CAR (APPEND (CDR X) Y)))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T
(LIST 'TIMES
(CAR X)
(TIMES-TREE (CDR X)))
A)))),
which again simplifies, applying REWRITE-EVAL$, CAR-CONS, CDR-CONS,
TIMES-ZERO, COMMUTATIVITY-OF-TIMES, and COMMUTATIVITY2-OF-TIMES, and
unfolding TIMES-TREE, FIX, ZEROP, EQUAL, and TIMES, to:
T.
Case 2.3.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (LISTP (APPEND (CDR X) Y))))
(EQUAL (EVAL$ T (LIST 'FIX (CAR X)) A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T
(LIST 'TIMES (CAR X) (CADR X))
A)))).
However this again simplifies, appealing to the lemmas REWRITE-EVAL$,
CAR-CONS, CDR-CONS, and COMMUTATIVITY2-OF-TIMES, and expanding the
functions TIMES-TREE, CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$, and FIX, to
two new conjectures:
Case 2.3.2.
(IMPLIES (AND (LISTP X)
(EQUAL 1
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (LISTP (APPEND (CDR X) Y)))
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL 0
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (CADR X) A)))),
which again simplifies, unfolding TIMES and EQUAL, to:
T.
Case 2.3.1.
(IMPLIES (AND (LISTP X)
(EQUAL 1
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (LISTP (APPEND (CDR X) Y)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T (CAR X) A)
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (CADR X) A)))),
which further simplifies, applying REWRITE-EVAL$, CAR-CONS, TIMES-ZERO,
COMMUTATIVITY-OF-TIMES, and TIMES-1-ARG1, and unfolding the functions
TIMES-TREE, FIX, ZEROP, EQUAL, and TIMES, to the new goal:
(IMPLIES (AND (LISTP X)
(NOT (NUMBERP (EVAL$ T (CADR X) A)))
(EQUAL 1
(TIMES (EVAL$ T (TIMES-TREE Y) A) 0))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (LISTP (APPEND (CDR X) Y)))
(NUMBERP (EVAL$ T (CAR X) A)))
(EQUAL (EVAL$ T (CAR X) A) 0)),
which again simplifies, rewriting with COMMUTATIVITY-OF-TIMES, and
opening up the definitions of EQUAL and TIMES, to:
T.
Case 2.2.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(LISTP (CDR (APPEND (CDR X) Y))))
(EQUAL (EVAL$ T
(LIST 'TIMES
(CAR X)
(TIMES-TREE (APPEND (CDR X) Y)))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T
(LIST 'TIMES (CAR X) (CADR X))
A)))).
However this again simplifies, rewriting with REWRITE-EVAL$, CAR-CONS,
CDR-CONS, and COMMUTATIVITY2-OF-TIMES, to:
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(LISTP (CDR (APPEND (CDR X) Y))))
(EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A))
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (CADR X) A)))),
which further simplifies, rewriting with the lemmas REWRITE-EVAL$,
CAR-CONS, COMMUTATIVITY-OF-TIMES, and TIMES-ZERO, and expanding TIMES-TREE,
FIX, EQUAL, TIMES, and ZEROP, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (CDR X) Y))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y)))))
(EQUAL (EVAL$ T
(LIST 'TIMES
(CAR X)
(CAR (APPEND (CDR X) Y)))
A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T
(LIST 'TIMES (CAR X) (CADR X))
A)))),
which again simplifies, applying REWRITE-EVAL$, CAR-CONS, CDR-CONS,
TIMES-ZERO, COMMUTATIVITY2-OF-TIMES, NUMBERP-EVAL$-TIMES-TREE, and
EQUAL-TIMES-0, and unfolding the definitions of TIMES-TREE, FIX, and ZEROP,
to the following two new goals:
Case 2.1.2.
(IMPLIES (AND (LISTP X)
(NOT (NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A)))
(EQUAL 0
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NOT (EQUAL 0 (EVAL$ T (CAR X) A)))
(NUMBERP (EVAL$ T (CAR X) A))
(NOT (EQUAL 0 (EVAL$ T (TIMES-TREE Y) A)))
(NOT (EQUAL 0 (EVAL$ T (CADR X) A))))
(NOT (NUMBERP (EVAL$ T (CADR X) A)))).
However this again simplifies, applying the lemmas
NUMBERP-EVAL$-TIMES-TREE and EQUAL-TIMES-0, to the goal:
(IMPLIES (AND (LISTP X)
(NOT (NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A)))
(EQUAL 0
(EVAL$ T (TIMES-TREE (CDR X)) A))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y))))
(NOT (EQUAL 0 (EVAL$ T (CAR X) A)))
(NUMBERP (EVAL$ T (CAR X) A))
(NOT (EQUAL 0 (EVAL$ T (TIMES-TREE Y) A)))
(NOT (EQUAL 0 (EVAL$ T (CADR X) A))))
(NOT (NUMBERP (EVAL$ T (CADR X) A)))).
But this further simplifies, applying REWRITE-EVAL$ and CAR-CONS, and
unfolding TIMES-TREE and FIX, to:
T.
Case 2.1.1.
(IMPLIES (AND (LISTP X)
(NUMBERP (EVAL$ T (CAR (APPEND (CDR X) Y)) A))
(EQUAL (EVAL$ T (CAR (APPEND (CDR X) Y)) A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y)))))
(EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (CAR (APPEND (CDR X) Y)) A))
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (CADR X) A)))).
This again simplifies, trivially, to:
(IMPLIES (AND (LISTP X)
(EQUAL (EVAL$ T (CAR (APPEND (CDR X) Y)) A)
(TIMES (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE (CDR X)) A)))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(LISTP (APPEND (CDR X) Y))
(NOT (LISTP (CDR (APPEND (CDR X) Y)))))
(EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (CAR (APPEND (CDR X) Y)) A))
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (CADR X) A)))),
which further simplifies, applying REWRITE-EVAL$, CAR-CONS,
COMMUTATIVITY-OF-TIMES, and TIMES-ZERO, and unfolding TIMES-TREE, FIX,
EQUAL, TIMES, and ZEROP, to:
T.
Case 1. (IMPLIES (NOT (LISTP X))
(EQUAL (EVAL$ T (TIMES-TREE (APPEND X Y)) A)
(TIMES (EVAL$ T (TIMES-TREE X) A)
(EVAL$ T (TIMES-TREE Y) A)))).
This simplifies, applying NUMBERP-EVAL$-TIMES-TREE and TIMES-1-ARG1, and
unfolding the functions APPEND, TIMES-TREE, CDR, CAR, LISTP, LITATOM, EQUAL,
and EVAL$, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 5.1 0.0 ]
TIMES-TREE-APPEND
(DISABLE TIMES-TREE-APPEND)
[ 0.0 0.0 0.0 ]
TIMES-TREE-APPEND-OFF
(LEMMA TIMES-TREE-OF-TIMES-FRINGE
(REWRITE)
(EQUAL (EVAL$ T
(TIMES-TREE (TIMES-FRINGE X))
A)
(FIX (EVAL$ T X A)))
((ENABLE COMMUTATIVITY-OF-TIMES EVAL$-TIMES TIMES-FRINGE TIMES-TREE
TIMES-TREE-APPEND TIMES-ZERO)
(INDUCT (TIMES-FRINGE X))))
This formula can be simplified, using the abbreviations NOT, OR, and AND, to
the following two new conjectures:
Case 2. (IMPLIES (AND (LISTP X)
(EQUAL (CAR X) 'TIMES)
(EQUAL (EVAL$ T
(TIMES-TREE (TIMES-FRINGE (CADDR X)))
A)
(FIX (EVAL$ T (CADDR X) A)))
(EQUAL (EVAL$ T
(TIMES-TREE (TIMES-FRINGE (CADR X)))
A)
(FIX (EVAL$ T (CADR X) A))))
(EQUAL (EVAL$ T
(TIMES-TREE (TIMES-FRINGE X))
A)
(FIX (EVAL$ T X A)))).
This simplifies, rewriting with TIMES-TREE-APPEND, TIMES-ZERO, EVAL$-TIMES,
and COMMUTATIVITY-OF-TIMES, and unfolding the definitions of FIX, EQUAL,
TIMES-FRINGE, TIMES, and ZEROP, to:
T.
Case 1. (IMPLIES (NOT (AND (LISTP X)
(EQUAL (CAR X) 'TIMES)))
(EQUAL (EVAL$ T
(TIMES-TREE (TIMES-FRINGE X))
A)
(FIX (EVAL$ T X A)))),
which simplifies, applying CAR-CONS, CDR-CONS, and REWRITE-EVAL$, and
expanding AND, TIMES-FRINGE, LISTP, TIMES-TREE, EQUAL, EVAL$, and FIX, to:
T.
Q.E.D.
[ 0.0 0.6 0.0 ]
TIMES-TREE-OF-TIMES-FRINGE
(DISABLE TIMES-TREE-OF-TIMES-FRINGE)
[ 0.0 0.0 0.0 ]
TIMES-TREE-OF-TIMES-FRINGE-OFF
(DEFN CANCEL-LESSP-TIMES
(X)
(IF (AND (EQUAL (CAR X) 'LESSP)
(EQUAL (CAADR X) 'TIMES)
(EQUAL (CAADDR X) 'TIMES))
(LET ((INBOTH (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))))
(IF (LISTP INBOTH)
(LIST 'AND
(AND-NOT-ZEROP-TREE INBOTH)
(LIST 'LESSP
(TIMES-TREE (BAGDIFF (TIMES-FRINGE (CADR X))
INBOTH))
(TIMES-TREE (BAGDIFF (TIMES-FRINGE (CADDR X))
INBOTH))))
X))
X))
Note that:
(OR (LISTP (CANCEL-LESSP-TIMES X))
(EQUAL (CANCEL-LESSP-TIMES X) X))
is a theorem.
[ 0.0 0.0 0.0 ]
CANCEL-LESSP-TIMES
(LEMMA EVAL$-LESSP-TIMES-TREE-BAGDIFF
(REWRITE)
(IMPLIES (AND (SUBBAGP X Y)
(SUBBAGP X Z)
(EVAL$ T (AND-NOT-ZEROP-TREE X) A))
(EQUAL (LESSP (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(LESSP (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A))))
((ENABLE AND-NOT-ZEROP-TREE BAGDIFF EVAL$-TIMES-MEMBER
LESSP-TIMES-CANCELLATION1 SUBBAGP SUBBAGP-CDR1 SUBBAGP-CDR2
TIMES-TREE ZEROP-MAKES-TIMES-TREE-ZERO)))
Give the conjecture the name *1.
We will try to prove it by induction. The recursive terms in the
conjecture suggest seven inductions. They merge into three likely candidate
inductions. However, only one is unflawed. We will induct according to the
following scheme:
(AND (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(p (DELETE (CAR X) Y)
(CDR X)
A
(DELETE (CAR X) Z)))
(p Y X A Z))
(IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) Y)))
(p Y X A Z))
(IMPLIES (NOT (LISTP X))
(p Y X A Z))).
Linear arithmetic and the lemma CDR-LESSP inform us that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instances chosen for Z and Y.
The above induction scheme produces six new goals:
Case 6. (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (SUBBAGP (CDR X) (DELETE (CAR X) Y)))
(SUBBAGP X Y)
(SUBBAGP X Z)
(EVAL$ T (AND-NOT-ZEROP-TREE X) A))
(EQUAL (LESSP (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(LESSP (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))),
which simplifies, opening up SUBBAGP, to:
T.
Case 5. (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (SUBBAGP (CDR X) (DELETE (CAR X) Z)))
(SUBBAGP X Y)
(SUBBAGP X Z)
(EVAL$ T (AND-NOT-ZEROP-TREE X) A))
(EQUAL (LESSP (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(LESSP (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))),
which simplifies, unfolding the definition of SUBBAGP, to:
T.
Case 4. (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (EVAL$ T
(AND-NOT-ZEROP-TREE (CDR X))
A))
(SUBBAGP X Y)
(SUBBAGP X Z)
(EVAL$ T (AND-NOT-ZEROP-TREE X) A))
(EQUAL (LESSP (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(LESSP (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))),
which simplifies, rewriting with ZEROP-MAKES-TIMES-TREE-ZERO and
SUBBAGP-CDR1, and unfolding SUBBAGP, AND-NOT-ZEROP-TREE, BAGDIFF, LESSP, and
EQUAL, to:
(IMPLIES
(AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (EVAL$ T
(AND-NOT-ZEROP-TREE (CDR X))
A))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(MEMBER (CAR X) Z)
(SUBBAGP (CDR X) (DELETE (CAR X) Z))
(LISTP (CDR X))
(EVAL$ T
(LIST 'AND
(LIST 'NOT (LIST 'ZEROP (CAR X)))
(AND-NOT-ZEROP-TREE (CDR X)))
A))
(NOT (LESSP (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A)))),
which again simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, and CDR-CONS,
and opening up the definitions of ZEROP, NOT, and AND, to:
T.
Case 3. (IMPLIES
(AND
(LISTP X)
(MEMBER (CAR X) Y)
(EQUAL
(LESSP (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A))
(LESSP (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A)))
(SUBBAGP X Y)
(SUBBAGP X Z)
(EVAL$ T (AND-NOT-ZEROP-TREE X) A))
(EQUAL (LESSP (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(LESSP (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))).
This simplifies, applying EVAL$-TIMES-MEMBER and LESSP-TIMES-CANCELLATION1,
and opening up the functions SUBBAGP, AND-NOT-ZEROP-TREE, and BAGDIFF, to
four new conjectures:
Case 3.4.
(IMPLIES
(AND
(LISTP X)
(MEMBER (CAR X) Y)
(EQUAL
(LESSP (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A))
(LESSP (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(MEMBER (CAR X) Z)
(SUBBAGP (CDR X) (DELETE (CAR X) Z))
(NOT (LISTP (CDR X)))
(EVAL$ T
(LIST 'NOT (LIST 'ZEROP (CAR X)))
A)
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL (LESSP (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A))
F)),
which again simplifies, rewriting with REWRITE-EVAL$ and CAR-CONS, and
opening up the functions ZEROP and NOT, to:
T.
Case 3.3.
(IMPLIES
(AND
(LISTP X)
(MEMBER (CAR X) Y)
(EQUAL
(LESSP (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A))
(LESSP (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(MEMBER (CAR X) Z)
(SUBBAGP (CDR X) (DELETE (CAR X) Z))
(NOT (LISTP (CDR X)))
(EVAL$ T
(LIST 'NOT (LIST 'ZEROP (CAR X)))
A)
(EQUAL (EVAL$ T (CAR X) A) 0))
(EQUAL (LESSP (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A))
F)).
However this again simplifies, applying REWRITE-EVAL$ and CAR-CONS, and
opening up the definitions of ZEROP and NOT, to:
T.
Case 3.2.
(IMPLIES
(AND
(LISTP X)
(MEMBER (CAR X) Y)
(EQUAL
(LESSP (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A))
(LESSP (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(MEMBER (CAR X) Z)
(SUBBAGP (CDR X) (DELETE (CAR X) Z))
(LISTP (CDR X))
(EVAL$ T
(LIST 'AND
(LIST 'NOT (LIST 'ZEROP (CAR X)))
(AND-NOT-ZEROP-TREE (CDR X)))
A)
(NOT (NUMBERP (EVAL$ T (CAR X) A))))
(EQUAL (LESSP (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A))
F)).
This again simplifies, rewriting with the lemmas REWRITE-EVAL$, CAR-CONS,
and CDR-CONS, and expanding the functions ZEROP, NOT, and AND, to:
T.
Case 3.1.
(IMPLIES
(AND
(LISTP X)
(MEMBER (CAR X) Y)
(EQUAL
(LESSP (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A))
(LESSP (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(MEMBER (CAR X) Z)
(SUBBAGP (CDR X) (DELETE (CAR X) Z))
(LISTP (CDR X))
(EVAL$ T
(LIST 'AND
(LIST 'NOT (LIST 'ZEROP (CAR X)))
(AND-NOT-ZEROP-TREE (CDR X)))
A)
(EQUAL (EVAL$ T (CAR X) A) 0))
(EQUAL (LESSP (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A))
F)),
which again simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, and expanding ZEROP, NOT, and AND, to:
T.
Case 2. (IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) Y))
(SUBBAGP X Y)
(SUBBAGP X Z)
(EVAL$ T (AND-NOT-ZEROP-TREE X) A))
(EQUAL (LESSP (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(LESSP (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))).
This simplifies, opening up SUBBAGP, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP X))
(SUBBAGP X Y)
(SUBBAGP X Z)
(EVAL$ T (AND-NOT-ZEROP-TREE X) A))
(EQUAL (LESSP (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(LESSP (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))).
This simplifies, applying SUBBAGP-CDR2 and REWRITE-EVAL$, and expanding the
functions SUBBAGP, AND-NOT-ZEROP-TREE, and BAGDIFF, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 1.1 0.1 ]
EVAL$-LESSP-TIMES-TREE-BAGDIFF
(DISABLE EVAL$-LESSP-TIMES-TREE-BAGDIFF)
[ 0.0 0.0 0.0 ]
EVAL$-LESSP-TIMES-TREE-BAGDIFF-OFF
(LEMMA ZEROP-MAKES-LESSP-FALSE-BRIDGE
(REWRITE)
(IMPLIES (AND (EQUAL (CAR X) 'TIMES)
(EQUAL (CAR Y) 'TIMES)
(NOT (EVAL$ T
(AND-NOT-ZEROP-TREE (BAGINT (TIMES-FRINGE X)
(TIMES-FRINGE Y)))
A)))
(EQUAL (LESSP (TIMES (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A))
(TIMES (EVAL$ T (CADR Y) A)
(EVAL$ T (CADDR Y) A)))
F))
((ENABLE AND-NOT-ZEROP-TREE BAGINT COMMUTATIVITY-OF-TIMES DELETE
EQUAL-TIMES-0 EVAL$-TIMES SUBBAGP-BAGINT1 SUBBAGP-BAGINT2
TIMES-FRINGE TIMES-TREE TIMES-TREE-APPEND
TIMES-TREE-OF-TIMES-FRINGE TIMES-ZERO)
(USE (ZEROP-MAKES-TIMES-TREE-ZERO (X (BAGINT (TIMES-FRINGE X)
(TIMES-FRINGE Y)))
(Y (TIMES-FRINGE X)))
(ZEROP-MAKES-TIMES-TREE-ZERO (X (BAGINT (TIMES-FRINGE X)
(TIMES-FRINGE Y)))
(Y (TIMES-FRINGE Y))))))
This simplifies, applying SUBBAGP-BAGINT1, CDR-CONS, CAR-CONS, REWRITE-EVAL$,
CDR-NLISTP, EVAL$-TIMES, CAR-NLISTP, SUBBAGP-BAGINT2,
TIMES-TREE-OF-TIMES-FRINGE, TIMES-TREE-APPEND, and EQUAL-TIMES-0, and
unfolding the definitions of EQUAL, TIMES-FRINGE, NOT, AND, IMPLIES, DELETE,
LISTP, MEMBER, BAGINT, TIMES-TREE, CAR, LITATOM, EVAL$, CDR, TIMES, and FIX,
to:
(IMPLIES
(AND
(LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
A)
0)
(LISTP Y)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (TIMES-FRINGE (CADR Y))
(TIMES-FRINGE (CADDR Y))))
A)
0)
(EQUAL (CAR X) 'TIMES)
(EQUAL (CAR Y) 'TIMES)
(NOT
(EVAL$ T
(AND-NOT-ZEROP-TREE (BAGINT (APPEND (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))
(APPEND (TIMES-FRINGE (CADR Y))
(TIMES-FRINGE (CADDR Y)))))
A)))
(NOT (LESSP (TIMES (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A))
(TIMES (EVAL$ T (CADR Y) A)
(EVAL$ T (CADDR Y) A))))).
This again simplifies, applying TIMES-TREE-OF-TIMES-FRINGE, TIMES-TREE-APPEND,
EQUAL-TIMES-0, COMMUTATIVITY-OF-TIMES, and TIMES-ZERO, and unfolding the
functions EQUAL, TIMES, LESSP, and ZEROP, to:
T.
Q.E.D.
[ 0.0 4.1 0.0 ]
ZEROP-MAKES-LESSP-FALSE-BRIDGE
(DISABLE ZEROP-MAKES-LESSP-FALSE-BRIDGE)
[ 0.0 0.0 0.0 ]
ZEROP-MAKES-LESSP-FALSE-BRIDGE-OFF
(LEMMA CORRECTNESS-OF-CANCEL-LESSP-TIMES
((META LESSP))
(EQUAL (EVAL$ T X A)
(EVAL$ T (CANCEL-LESSP-TIMES X) A))
((ENABLE CANCEL-LESSP-TIMES EVAL$-LESSP-TIMES-TREE-BAGDIFF EVAL$-LESSP
EVAL$-TIMES SUBBAGP-BAGINT1 SUBBAGP-BAGINT2
TIMES-TREE-OF-TIMES-FRINGE ZEROP-MAKES-LESSP-FALSE-BRIDGE)))
This formula simplifies, opening up the function CANCEL-LESSP-TIMES, to:
(IMPLIES
(AND (EQUAL (CAR X) 'LESSP)
(EQUAL (CAADR X) 'TIMES)
(EQUAL (CAADDR X) 'TIMES)
(LISTP (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))))
(EQUAL
(EVAL$ T X A)
(EVAL$ T
(LIST 'AND
(AND-NOT-ZEROP-TREE (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
(LIST 'LESSP
(TIMES-TREE (BAGDIFF (TIMES-FRINGE (CADR X))
(BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))))
(TIMES-TREE (BAGDIFF (TIMES-FRINGE (CADDR X))
(BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))))))
A))),
which again simplifies, rewriting with EVAL$-TIMES, EVAL$-LESSP, REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, and opening up AND, to the following two new formulas:
Case 2. (IMPLIES
(AND
(EQUAL (CAR X) 'LESSP)
(EQUAL (CAADR X) 'TIMES)
(EQUAL (CAADDR X) 'TIMES)
(LISTP (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
(NOT (EVAL$ T
(AND-NOT-ZEROP-TREE (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
A)))
(EQUAL (LESSP (TIMES (EVAL$ T (CADADR X) A)
(EVAL$ T (CADDADR X) A))
(TIMES (EVAL$ T (CADADDR X) A)
(EVAL$ T (CADDADDR X) A)))
F)).
However this again simplifies, applying ZEROP-MAKES-LESSP-FALSE-BRIDGE, and
unfolding the definition of EQUAL, to:
T.
Case 1. (IMPLIES
(AND (EQUAL (CAR X) 'LESSP)
(EQUAL (CAADR X) 'TIMES)
(EQUAL (CAADDR X) 'TIMES)
(LISTP (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
(EVAL$ T
(AND-NOT-ZEROP-TREE (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
A))
(EQUAL
(LESSP (TIMES (EVAL$ T (CADADR X) A)
(EVAL$ T (CADDADR X) A))
(TIMES (EVAL$ T (CADADDR X) A)
(EVAL$ T (CADDADDR X) A)))
(LESSP
(EVAL$ T
(TIMES-TREE (BAGDIFF (TIMES-FRINGE (CADR X))
(BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (TIMES-FRINGE (CADDR X))
(BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))))
A)))).
This again simplifies, rewriting with SUBBAGP-BAGINT2, SUBBAGP-BAGINT1,
EVAL$-TIMES, TIMES-TREE-OF-TIMES-FRINGE, and EVAL$-LESSP-TIMES-TREE-BAGDIFF,
to:
T.
Q.E.D.
[ 0.0 1.0 0.0 ]
CORRECTNESS-OF-CANCEL-LESSP-TIMES
(DEFN CANCEL-EQUAL-TIMES
(X)
(IF (AND (EQUAL (CAR X) 'EQUAL)
(EQUAL (CAADR X) 'TIMES)
(EQUAL (CAADDR X) 'TIMES))
(LET ((INBOTH (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))))
(IF (LISTP INBOTH)
(LIST 'OR
(OR-ZEROP-TREE INBOTH)
(LIST 'EQUAL
(TIMES-TREE (BAGDIFF (TIMES-FRINGE (CADR X))
INBOTH))
(TIMES-TREE (BAGDIFF (TIMES-FRINGE (CADDR X))
INBOTH))))
X))
X))
Note that:
(OR (LISTP (CANCEL-EQUAL-TIMES X))
(EQUAL (CANCEL-EQUAL-TIMES X) X))
is a theorem.
[ 0.0 0.0 0.0 ]
CANCEL-EQUAL-TIMES
(LEMMA ZEROP-MAKES-EQUAL-TRUE-BRIDGE
(REWRITE)
(IMPLIES (AND (EQUAL (CAR X) 'TIMES)
(EQUAL (CAR Y) 'TIMES)
(EVAL$ T
(OR-ZEROP-TREE (BAGINT (TIMES-FRINGE X)
(TIMES-FRINGE Y)))
A))
(EQUAL (EQUAL (TIMES (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A))
(TIMES (EVAL$ T (CADR Y) A)
(EVAL$ T (CADDR Y) A)))
T))
((ENABLE BAGINT COMMUTATIVITY-OF-TIMES DELETE EQUAL-TIMES-0 EVAL$-TIMES
OR-ZEROP-TREE SUBBAGP-BAGINT1 SUBBAGP-BAGINT2 TIMES-FRINGE
TIMES-TREE TIMES-TREE-APPEND TIMES-TREE-OF-TIMES-FRINGE
TIMES-ZERO)
(USE (ZEROP-MAKES-TIMES-TREE-ZERO2 (X (BAGINT (TIMES-FRINGE X)
(TIMES-FRINGE Y)))
(Y (TIMES-FRINGE X)))
(ZEROP-MAKES-TIMES-TREE-ZERO2 (X (BAGINT (TIMES-FRINGE X)
(TIMES-FRINGE Y)))
(Y (TIMES-FRINGE Y))))))
This formula simplifies, rewriting with SUBBAGP-BAGINT1, CDR-CONS, CAR-CONS,
REWRITE-EVAL$, CDR-NLISTP, EVAL$-TIMES, CAR-NLISTP, SUBBAGP-BAGINT2,
TIMES-TREE-OF-TIMES-FRINGE, TIMES-TREE-APPEND, and EQUAL-TIMES-0, and opening
up EQUAL, TIMES-FRINGE, AND, IMPLIES, DELETE, LISTP, MEMBER, BAGINT,
TIMES-TREE, CAR, LITATOM, EVAL$, CDR, TIMES, and FIX, to the formula:
(IMPLIES
(AND (LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
A)
0)
(LISTP Y)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (TIMES-FRINGE (CADR Y))
(TIMES-FRINGE (CADDR Y))))
A)
0)
(EQUAL (CAR X) 'TIMES)
(EQUAL (CAR Y) 'TIMES)
(EVAL$ T
(OR-ZEROP-TREE (BAGINT (APPEND (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))
(APPEND (TIMES-FRINGE (CADR Y))
(TIMES-FRINGE (CADDR Y)))))
A))
(EQUAL (TIMES (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A))
(TIMES (EVAL$ T (CADR Y) A)
(EVAL$ T (CADDR Y) A)))).
This again simplifies, applying the lemmas TIMES-TREE-OF-TIMES-FRINGE,
TIMES-TREE-APPEND, EQUAL-TIMES-0, COMMUTATIVITY-OF-TIMES, and TIMES-ZERO, and
expanding the definitions of EQUAL, TIMES, and ZEROP, to:
T.
Q.E.D.
[ 0.0 4.0 0.0 ]
ZEROP-MAKES-EQUAL-TRUE-BRIDGE
(DISABLE ZEROP-MAKES-EQUAL-TRUE-BRIDGE)
[ 0.0 0.0 0.0 ]
ZEROP-MAKES-EQUAL-TRUE-BRIDGE-OFF
(LEMMA EVAL$-EQUAL-TIMES-TREE-BAGDIFF
(REWRITE)
(IMPLIES (AND (SUBBAGP X Y)
(SUBBAGP X Z)
(NOT (EVAL$ T (OR-ZEROP-TREE X) A)))
(EQUAL (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(EQUAL (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A))))
((ENABLE AND-NOT-ZEROP-TREE BAGDIFF EQUAL-TIMES-ARG1
EVAL$-TIMES-MEMBER NUMBERP-EVAL$-TIMES-TREE OR-ZEROP-TREE
OR-ZEROP-TREE-IS-NOT-ZEROP-TREE SUBBAGP SUBBAGP-CDR1
SUBBAGP-CDR2 TIMES-TREE ZEROP-MAKES-TIMES-TREE-ZERO)))
This conjecture can be simplified, using the abbreviations
OR-ZEROP-TREE-IS-NOT-ZEROP-TREE, NOT, AND, and IMPLIES, to:
(IMPLIES (AND (SUBBAGP X Y)
(SUBBAGP X Z)
(EVAL$ T (AND-NOT-ZEROP-TREE X) A))
(EQUAL (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(EQUAL (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))).
This simplifies, obviously, to the following two new conjectures:
Case 2. (IMPLIES (AND (SUBBAGP X Y)
(SUBBAGP X Z)
(EVAL$ T (AND-NOT-ZEROP-TREE X) A)
(NOT (EQUAL (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A))))
(NOT (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A)))).
Call the above conjecture *1.
Case 1. (IMPLIES (AND (SUBBAGP X Y)
(SUBBAGP X Z)
(EVAL$ T (AND-NOT-ZEROP-TREE X) A)
(EQUAL (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))
(EQUAL (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
T)).
This again simplifies, clearly, to the new conjecture:
(IMPLIES (AND (SUBBAGP X Y)
(SUBBAGP X Z)
(EVAL$ T (AND-NOT-ZEROP-TREE X) A)
(EQUAL (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))
(EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))),
which we would normally push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us return to:
(IMPLIES (AND (SUBBAGP X Y)
(SUBBAGP X Z)
(NOT (EVAL$ T (OR-ZEROP-TREE X) A)))
(EQUAL (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(EQUAL (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))),
named *1. Let us appeal to the induction principle. There are seven
plausible inductions. They merge into three likely candidate inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(p (DELETE (CAR X) Y)
(CDR X)
A
(DELETE (CAR X) Z)))
(p Y X A Z))
(IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) Y)))
(p Y X A Z))
(IMPLIES (NOT (LISTP X))
(p Y X A Z))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure (COUNT X)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instances chosen for Z and Y.
The above induction scheme produces six new formulas:
Case 6. (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (SUBBAGP (CDR X) (DELETE (CAR X) Y)))
(SUBBAGP X Y)
(SUBBAGP X Z)
(NOT (EVAL$ T (OR-ZEROP-TREE X) A)))
(EQUAL (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(EQUAL (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))),
which simplifies, opening up the function SUBBAGP, to:
T.
Case 5. (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (SUBBAGP (CDR X) (DELETE (CAR X) Z)))
(SUBBAGP X Y)
(SUBBAGP X Z)
(NOT (EVAL$ T (OR-ZEROP-TREE X) A)))
(EQUAL (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(EQUAL (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))),
which simplifies, expanding SUBBAGP, to:
T.
Case 4. (IMPLIES (AND (LISTP X)
(MEMBER (CAR X) Y)
(EVAL$ T (OR-ZEROP-TREE (CDR X)) A)
(SUBBAGP X Y)
(SUBBAGP X Z)
(NOT (EVAL$ T (OR-ZEROP-TREE X) A)))
(EQUAL (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(EQUAL (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))),
which simplifies, applying OR-ZEROP-TREE-IS-NOT-ZEROP-TREE,
ZEROP-MAKES-TIMES-TREE-ZERO, and SUBBAGP-CDR1, and unfolding the functions
SUBBAGP, OR-ZEROP-TREE, BAGDIFF, and EQUAL, to the following two new
formulas:
Case 4.2.
(IMPLIES
(AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (EVAL$ T
(AND-NOT-ZEROP-TREE (CDR X))
A))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(MEMBER (CAR X) Z)
(SUBBAGP (CDR X) (DELETE (CAR X) Z))
(LISTP (CDR X))
(LISTP (CDDR X))
(NOT (EVAL$ T
(LIST 'OR
(LIST 'ZEROP (CAR X))
(OR-ZEROP-TREE (CDR X)))
A)))
(EQUAL (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A))).
However this again simplifies, rewriting with REWRITE-EVAL$, CAR-CONS,
CDR-CONS, and OR-ZEROP-TREE-IS-NOT-ZEROP-TREE, and expanding the functions
ZEROP and OR, to:
T.
Case 4.1.
(IMPLIES
(AND (LISTP X)
(MEMBER (CAR X) Y)
(NOT (EVAL$ T
(AND-NOT-ZEROP-TREE (CDR X))
A))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(MEMBER (CAR X) Z)
(SUBBAGP (CDR X) (DELETE (CAR X) Z))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (EVAL$ T
(LIST 'OR
(LIST 'ZEROP (CAR X))
(LIST 'ZEROP (CADR X)))
A)))
(EQUAL (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A))).
But this again simplifies, applying REWRITE-EVAL$, CAR-CONS, and CDR-CONS,
and unfolding the definitions of AND-NOT-ZEROP-TREE, ZEROP, NOT, and OR,
to:
T.
Case 3. (IMPLIES
(AND
(LISTP X)
(MEMBER (CAR X) Y)
(EQUAL
(EQUAL (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A))
(EQUAL (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A)))
(SUBBAGP X Y)
(SUBBAGP X Z)
(NOT (EVAL$ T (OR-ZEROP-TREE X) A)))
(EQUAL (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(EQUAL (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))).
This simplifies, rewriting with the lemma EVAL$-TIMES-MEMBER, and unfolding
the functions SUBBAGP, OR-ZEROP-TREE, BAGDIFF, and EQUAL, to the following
three new conjectures:
Case 3.3.
(IMPLIES
(AND
(LISTP X)
(MEMBER (CAR X) Y)
(NOT (EQUAL (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A)))
(NOT
(EQUAL (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(MEMBER (CAR X) Z)
(SUBBAGP (CDR X) (DELETE (CAR X) Z))
(NOT (LISTP (CDR X)))
(NOT (EVAL$ T (LIST 'ZEROP (CAR X)) A)))
(NOT (EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A))
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A))))).
But this again simplifies, appealing to the lemmas REWRITE-EVAL$, CAR-CONS,
NUMBERP-EVAL$-TIMES-TREE, and EQUAL-TIMES-ARG1, and unfolding ZEROP, to:
T.
Case 3.2.
(IMPLIES
(AND
(LISTP X)
(MEMBER (CAR X) Y)
(NOT (EQUAL (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A)))
(NOT
(EQUAL (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(MEMBER (CAR X) Z)
(SUBBAGP (CDR X) (DELETE (CAR X) Z))
(LISTP (CDR X))
(LISTP (CDDR X))
(NOT (EVAL$ T
(LIST 'OR
(LIST 'ZEROP (CAR X))
(OR-ZEROP-TREE (CDR X)))
A)))
(NOT (EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A))
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A))))),
which again simplifies, applying REWRITE-EVAL$, CAR-CONS, CDR-CONS,
OR-ZEROP-TREE-IS-NOT-ZEROP-TREE, NUMBERP-EVAL$-TIMES-TREE, and
EQUAL-TIMES-ARG1, and expanding ZEROP and OR, to:
T.
Case 3.1.
(IMPLIES
(AND
(LISTP X)
(MEMBER (CAR X) Y)
(NOT (EQUAL (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A)))
(NOT
(EQUAL (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A)))
(SUBBAGP (CDR X) (DELETE (CAR X) Y))
(MEMBER (CAR X) Z)
(SUBBAGP (CDR X) (DELETE (CAR X) Z))
(LISTP (CDR X))
(NOT (LISTP (CDDR X)))
(NOT (EVAL$ T
(LIST 'OR
(LIST 'ZEROP (CAR X))
(LIST 'ZEROP (CADR X)))
A)))
(NOT (EQUAL (TIMES (EVAL$ T (CAR X) A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A))
(TIMES (EVAL$ T (CAR X) A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A))))).
However this again simplifies, rewriting with REWRITE-EVAL$, CAR-CONS,
CDR-CONS, NUMBERP-EVAL$-TIMES-TREE, and EQUAL-TIMES-ARG1, and expanding
the functions ZEROP and OR, to:
T.
Case 2. (IMPLIES (AND (LISTP X)
(NOT (MEMBER (CAR X) Y))
(SUBBAGP X Y)
(SUBBAGP X Z)
(NOT (EVAL$ T (OR-ZEROP-TREE X) A)))
(EQUAL (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(EQUAL (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))).
This simplifies, expanding the definition of SUBBAGP, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP X))
(SUBBAGP X Y)
(SUBBAGP X Z)
(NOT (EVAL$ T (OR-ZEROP-TREE X) A)))
(EQUAL (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(EQUAL (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))).
This simplifies, rewriting with SUBBAGP-CDR2 and REWRITE-EVAL$, and
unfolding the functions SUBBAGP, OR-ZEROP-TREE, and BAGDIFF, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 2.5 0.1 ]
EVAL$-EQUAL-TIMES-TREE-BAGDIFF
(DISABLE EVAL$-EQUAL-TIMES-TREE-BAGDIFF)
[ 0.0 0.0 0.0 ]
EVAL$-EQUAL-TIMES-TREE-BAGDIFF-OFF
(LEMMA CANCEL-EQUAL-TIMES-PRESERVES-INEQUALITY
(REWRITE)
(IMPLIES (AND (SUBBAGP Z X)
(SUBBAGP Z Y)
(NOT (EQUAL (EVAL$ T (TIMES-TREE X) A)
(EVAL$ T (TIMES-TREE Y) A))))
(NOT (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF X Z)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Y Z))
A))))
((ENABLE BAGDIFF EVAL$-TIMES-MEMBER SUBBAGP SUBBAGP-CDR2 TIMES-TREE)))
Call the conjecture *1.
Perhaps we can prove it by induction. The recursive terms in the
conjecture suggest six inductions. They merge into three likely candidate
inductions. However, only one is unflawed. We will induct according to the
following scheme:
(AND (IMPLIES (AND (LISTP Z)
(MEMBER (CAR Z) X)
(p (DELETE (CAR Z) X)
(CDR Z)
A
(DELETE (CAR Z) Y)))
(p X Z A Y))
(IMPLIES (AND (LISTP Z)
(NOT (MEMBER (CAR Z) X)))
(p X Z A Y))
(IMPLIES (NOT (LISTP Z))
(p X Z A Y))).
Linear arithmetic and the lemma CDR-LESSP establish that the measure (COUNT Z)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. Note, however, the inductive instances chosen for Y and X.
The above induction scheme leads to the following six new goals:
Case 6. (IMPLIES (AND (LISTP Z)
(MEMBER (CAR Z) X)
(NOT (SUBBAGP (CDR Z) (DELETE (CAR Z) X)))
(SUBBAGP Z X)
(SUBBAGP Z Y)
(NOT (EQUAL (EVAL$ T (TIMES-TREE X) A)
(EVAL$ T (TIMES-TREE Y) A))))
(NOT (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF X Z)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Y Z))
A)))).
This simplifies, opening up the definition of SUBBAGP, to:
T.
Case 5. (IMPLIES (AND (LISTP Z)
(MEMBER (CAR Z) X)
(NOT (SUBBAGP (CDR Z) (DELETE (CAR Z) Y)))
(SUBBAGP Z X)
(SUBBAGP Z Y)
(NOT (EQUAL (EVAL$ T (TIMES-TREE X) A)
(EVAL$ T (TIMES-TREE Y) A))))
(NOT (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF X Z)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Y Z))
A)))).
This simplifies, expanding the function SUBBAGP, to:
T.
Case 4. (IMPLIES (AND (LISTP Z)
(MEMBER (CAR Z) X)
(EQUAL (EVAL$ T
(TIMES-TREE (DELETE (CAR Z) X))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR Z) Y))
A))
(SUBBAGP Z X)
(SUBBAGP Z Y)
(NOT (EQUAL (EVAL$ T (TIMES-TREE X) A)
(EVAL$ T (TIMES-TREE Y) A))))
(NOT (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF X Z)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Y Z))
A)))).
This simplifies, applying EVAL$-TIMES-MEMBER, and expanding the function
SUBBAGP, to:
T.
Case 3. (IMPLIES
(AND
(LISTP Z)
(MEMBER (CAR Z) X)
(NOT (EQUAL (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR Z) X) (CDR Z)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR Z) Y) (CDR Z)))
A)))
(SUBBAGP Z X)
(SUBBAGP Z Y)
(NOT (EQUAL (EVAL$ T (TIMES-TREE X) A)
(EVAL$ T (TIMES-TREE Y) A))))
(NOT (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF X Z)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Y Z))
A)))),
which simplifies, applying the lemma EVAL$-TIMES-MEMBER, and expanding the
functions SUBBAGP and BAGDIFF, to:
T.
Case 2. (IMPLIES (AND (LISTP Z)
(NOT (MEMBER (CAR Z) X))
(SUBBAGP Z X)
(SUBBAGP Z Y)
(NOT (EQUAL (EVAL$ T (TIMES-TREE X) A)
(EVAL$ T (TIMES-TREE Y) A))))
(NOT (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF X Z)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Y Z))
A)))),
which simplifies, unfolding the function SUBBAGP, to:
T.
Case 1. (IMPLIES (AND (NOT (LISTP Z))
(SUBBAGP Z X)
(SUBBAGP Z Y)
(NOT (EQUAL (EVAL$ T (TIMES-TREE X) A)
(EVAL$ T (TIMES-TREE Y) A))))
(NOT (EQUAL (EVAL$ T (TIMES-TREE (BAGDIFF X Z)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Y Z))
A)))),
which simplifies, rewriting with the lemma SUBBAGP-CDR2, and opening up
SUBBAGP and BAGDIFF, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.4 0.0 ]
CANCEL-EQUAL-TIMES-PRESERVES-INEQUALITY
(DISABLE CANCEL-EQUAL-TIMES-PRESERVES-INEQUALITY)
[ 0.0 0.0 0.0 ]
CANCEL-EQUAL-TIMES-PRESERVES-INEQUALITY-OFF
(LEMMA CANCEL-EQUAL-TIMES-PRESERVES-INEQUALITY-BRIDGE
(REWRITE)
(IMPLIES (AND (EQUAL (CAR X) 'TIMES)
(EQUAL (CAR Y) 'TIMES)
(NOT (EQUAL (TIMES (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A))
(TIMES (EVAL$ T (CADR Y) A)
(EVAL$ T (CADDR Y) A)))))
(NOT (EQUAL (EVAL$ T
(TIMES-TREE (BAGDIFF (TIMES-FRINGE X)
(BAGINT (TIMES-FRINGE X)
(TIMES-FRINGE Y))))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (TIMES-FRINGE Y)
(BAGINT (TIMES-FRINGE X)
(TIMES-FRINGE Y))))
A))))
((ENABLE BAGDIFF BAGINT COMMUTATIVITY-OF-TIMES SUBBAGP-BAGINT1
SUBBAGP-BAGINT2 TIMES-FRINGE TIMES-TREE TIMES-TREE-APPEND
TIMES-TREE-OF-TIMES-FRINGE TIMES-ZERO)
(USE (CANCEL-EQUAL-TIMES-PRESERVES-INEQUALITY (Z (BAGINT (TIMES-FRINGE X)
(TIMES-FRINGE Y)))
(X (TIMES-FRINGE X))
(Y (TIMES-FRINGE Y))))))
This simplifies, applying SUBBAGP-BAGINT1, SUBBAGP-BAGINT2, and CAR-NLISTP,
and opening up EQUAL, TIMES-FRINGE, NOT, AND, and IMPLIES, to:
(IMPLIES
(AND (LISTP Y)
(LISTP X)
(EQUAL (EVAL$ T
(TIMES-TREE (APPEND (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
A)
(EVAL$ T
(TIMES-TREE (APPEND (TIMES-FRINGE (CADR Y))
(TIMES-FRINGE (CADDR Y))))
A))
(EQUAL (CAR X) 'TIMES)
(EQUAL (CAR Y) 'TIMES)
(NOT (EQUAL (TIMES (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A))
(TIMES (EVAL$ T (CADR Y) A)
(EVAL$ T (CADDR Y) A)))))
(NOT
(EQUAL
(EVAL$ T
(TIMES-TREE (BAGDIFF (APPEND (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))
(BAGINT (APPEND (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))
(APPEND (TIMES-FRINGE (CADR Y))
(TIMES-FRINGE (CADDR Y))))))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (APPEND (TIMES-FRINGE (CADR Y))
(TIMES-FRINGE (CADDR Y)))
(BAGINT (APPEND (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))
(APPEND (TIMES-FRINGE (CADR Y))
(TIMES-FRINGE (CADDR Y))))))
A)))),
which again simplifies, rewriting with TIMES-TREE-OF-TIMES-FRINGE,
TIMES-TREE-APPEND, TIMES-ZERO, and COMMUTATIVITY-OF-TIMES, and expanding the
functions TIMES, EQUAL, and ZEROP, to:
T.
Q.E.D.
[ 0.0 2.2 0.0 ]
CANCEL-EQUAL-TIMES-PRESERVES-INEQUALITY-BRIDGE
(DISABLE CANCEL-EQUAL-TIMES-PRESERVES-INEQUALITY-BRIDGE)
[ 0.0 0.0 0.0 ]
CANCEL-EQUAL-TIMES-PRESERVES-INEQUALITY-BRIDGE-OFF
(LEMMA CORRECTNESS-OF-CANCEL-EQUAL-TIMES
((META EQUAL))
(EQUAL (EVAL$ T X A)
(EVAL$ T (CANCEL-EQUAL-TIMES X) A))
((ENABLE CANCEL-EQUAL-TIMES
CANCEL-EQUAL-TIMES-PRESERVES-INEQUALITY-BRIDGE EVAL$-EQUAL
EVAL$-EQUAL-TIMES-TREE-BAGDIFF EVAL$-TIMES SUBBAGP-BAGINT1
SUBBAGP-BAGINT2 TIMES-TREE-OF-TIMES-FRINGE
ZEROP-MAKES-EQUAL-TRUE-BRIDGE)))
This formula simplifies, opening up the function CANCEL-EQUAL-TIMES, to:
(IMPLIES
(AND (EQUAL (CAR X) 'EQUAL)
(EQUAL (CAADR X) 'TIMES)
(EQUAL (CAADDR X) 'TIMES)
(LISTP (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))))
(EQUAL
(EVAL$ T X A)
(EVAL$ T
(LIST 'OR
(OR-ZEROP-TREE (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
(LIST 'EQUAL
(TIMES-TREE (BAGDIFF (TIMES-FRINGE (CADR X))
(BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))))
(TIMES-TREE (BAGDIFF (TIMES-FRINGE (CADDR X))
(BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))))))
A))),
which again simplifies, rewriting with EVAL$-TIMES, EVAL$-EQUAL, REWRITE-EVAL$,
CAR-CONS, and CDR-CONS, and opening up OR, to the following three new formulas:
Case 3. (IMPLIES (AND (EQUAL (CAR X) 'EQUAL)
(EQUAL (CAADR X) 'TIMES)
(EQUAL (CAADDR X) 'TIMES)
(LISTP (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
(NOT (EQUAL (TIMES (EVAL$ T (CADADR X) A)
(EVAL$ T (CADDADR X) A))
(TIMES (EVAL$ T (CADADDR X) A)
(EVAL$ T (CADDADDR X) A)))))
(NOT (EVAL$ T
(OR-ZEROP-TREE (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
A))).
However this again simplifies, applying ZEROP-MAKES-EQUAL-TRUE-BRIDGE, to:
T.
Case 2. (IMPLIES
(AND (EQUAL (CAR X) 'EQUAL)
(EQUAL (CAADR X) 'TIMES)
(EQUAL (CAADDR X) 'TIMES)
(LISTP (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
(NOT (EQUAL (TIMES (EVAL$ T (CADADR X) A)
(EVAL$ T (CADDADR X) A))
(TIMES (EVAL$ T (CADADDR X) A)
(EVAL$ T (CADDADDR X) A)))))
(NOT
(EQUAL
(EVAL$ T
(TIMES-TREE (BAGDIFF (TIMES-FRINGE (CADR X))
(BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (TIMES-FRINGE (CADDR X))
(BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))))
A)))).
This again simplifies, applying
CANCEL-EQUAL-TIMES-PRESERVES-INEQUALITY-BRIDGE, to:
T.
Case 1. (IMPLIES
(AND (EQUAL (CAR X) 'EQUAL)
(EQUAL (CAADR X) 'TIMES)
(EQUAL (CAADDR X) 'TIMES)
(LISTP (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
(EQUAL (TIMES (EVAL$ T (CADADR X) A)
(EVAL$ T (CADDADR X) A))
(TIMES (EVAL$ T (CADADDR X) A)
(EVAL$ T (CADDADDR X) A)))
(NOT (EVAL$ T
(OR-ZEROP-TREE (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
A)))
(EQUAL
(EQUAL
(EVAL$ T
(TIMES-TREE (BAGDIFF (TIMES-FRINGE (CADR X))
(BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (TIMES-FRINGE (CADDR X))
(BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X)))))
A))
T)).
However this again simplifies, applying SUBBAGP-BAGINT2, SUBBAGP-BAGINT1,
EVAL$-TIMES, TIMES-TREE-OF-TIMES-FRINGE, and EVAL$-EQUAL-TIMES-TREE-BAGDIFF,
and unfolding the function EQUAL, to:
T.
Q.E.D.
[ 0.0 2.0 0.0 ]
CORRECTNESS-OF-CANCEL-EQUAL-TIMES
(DEFTHEORY MULTIPLICATION
(EQUAL-TIMES-0 EQUAL-TIMES-1 EQUAL-SUB1-0 TIMES-ZERO TIMES-ADD1
COMMUTATIVITY-OF-TIMES TIMES-DISTRIBUTES-OVER-PLUS
COMMUTATIVITY2-OF-TIMES ASSOCIATIVITY-OF-TIMES
TIMES-DISTRIBUTES-OVER-DIFFERENCE TIMES-QUOTIENT
TIMES-1-ARG1 LESSP-TIMES1 LESSP-TIMES2 LESSP-TIMES3
LESSP-PLUS-TIMES1 LESSP-PLUS-TIMES2 LESSP-1-TIMES
CORRECTNESS-OF-CANCEL-LESSP-TIMES
CORRECTNESS-OF-CANCEL-EQUAL-TIMES))
[ 0.0 0.0 0.0 ]
MULTIPLICATION
(LEMMA LESSP-REMAINDER
(REWRITE GENERALIZE)
(EQUAL (LESSP (REMAINDER X Y) Y)
(NOT (ZEROP Y))))
This conjecture simplifies, expanding ZEROP and NOT, to the following three
new goals:
Case 3. (IMPLIES (NOT (NUMBERP Y))
(EQUAL (LESSP (REMAINDER X Y) Y) F)).
However this again simplifies, expanding the definitions of REMAINDER, LESSP,
and EQUAL, to:
T.
Case 2. (IMPLIES (EQUAL Y 0)
(EQUAL (LESSP (REMAINDER X Y) Y) F)),
which again simplifies, expanding the definitions of EQUAL, REMAINDER, and
LESSP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL Y 0)) (NUMBERP Y))
(EQUAL (LESSP (REMAINDER X Y) Y) T)),
which again simplifies, trivially, to the new formula:
(IMPLIES (AND (NOT (EQUAL Y 0)) (NUMBERP Y))
(LESSP (REMAINDER X Y) Y)),
which we will name *1.
We will appeal to induction. There are two plausible inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (ZEROP Y) (p X Y))
(IMPLIES (AND (NOT (ZEROP Y)) (LESSP X Y))
(p X Y))
(IMPLIES (AND (NOT (ZEROP Y))
(NOT (LESSP X Y))
(p (DIFFERENCE X Y) Y))
(p X Y))).
Linear arithmetic, the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP, and the
definition of ZEROP establish that the measure (COUNT X) decreases according
to the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme produces the following three new formulas:
Case 3. (IMPLIES (AND (ZEROP Y)
(NOT (EQUAL Y 0))
(NUMBERP Y))
(LESSP (REMAINDER X Y) Y)).
This simplifies, opening up ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP Y))
(LESSP X Y)
(NOT (EQUAL Y 0))
(NUMBERP Y))
(LESSP (REMAINDER X Y) Y)).
This simplifies, opening up the definitions of ZEROP and REMAINDER, to:
(IMPLIES (AND (LESSP X Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (NUMBERP X)))
(LESSP 0 Y)),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP Y))
(NOT (LESSP X Y))
(LESSP (REMAINDER (DIFFERENCE X Y) Y)
Y)
(NOT (EQUAL Y 0))
(NUMBERP Y))
(LESSP (REMAINDER X Y) Y)),
which simplifies, unfolding the functions ZEROP and REMAINDER, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-REMAINDER
(LEMMA REMAINDER-NOOP
(REWRITE)
(IMPLIES (LESSP A B)
(EQUAL (REMAINDER A B) (FIX A))))
This formula simplifies, expanding the functions REMAINDER and FIX, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-NOOP
(LEMMA REMAINDER-OF-NON-NUMBER
(REWRITE)
(IMPLIES (NOT (NUMBERP A))
(EQUAL (REMAINDER A N)
(REMAINDER 0 N))))
This simplifies, opening up the functions LESSP, REMAINDER, EQUAL, and NUMBERP,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-OF-NON-NUMBER
(LEMMA REMAINDER-ZERO
(REWRITE)
(IMPLIES (ZEROP X)
(EQUAL (REMAINDER Y X) (FIX Y))))
This conjecture simplifies, expanding ZEROP, EQUAL, REMAINDER, and FIX, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-ZERO
(LEMMA PLUS-REMAINDER-TIMES-QUOTIENT
(REWRITE)
(EQUAL (PLUS (REMAINDER X Y)
(TIMES Y (QUOTIENT X Y)))
(FIX X))
((ENABLE COMMUTATIVITY2-OF-PLUS COMMUTATIVITY-OF-PLUS TIMES-ZERO
TIMES-ADD1 COMMUTATIVITY-OF-TIMES)))
WARNING: the previously added lemma, COMMUTATIVITY-OF-PLUS, could be applied
whenever the newly proposed PLUS-REMAINDER-TIMES-QUOTIENT could!
This formula simplifies, opening up the function FIX, to the following two new
goals:
Case 2. (IMPLIES (NOT (NUMBERP X))
(EQUAL (PLUS (REMAINDER X Y)
(TIMES Y (QUOTIENT X Y)))
0)).
However this again simplifies, rewriting with COMMUTATIVITY-OF-TIMES, and
opening up LESSP, REMAINDER, QUOTIENT, EQUAL, TIMES, and PLUS, to:
T.
Case 1. (IMPLIES (NUMBERP X)
(EQUAL (PLUS (REMAINDER X Y)
(TIMES Y (QUOTIENT X Y)))
X)).
Call the above conjecture *1.
We will appeal to induction. Three inductions are suggested by terms in
the conjecture. They merge into two likely candidate inductions. However,
only one is unflawed. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP Y) (p X Y))
(IMPLIES (AND (NOT (ZEROP Y)) (LESSP X Y))
(p X Y))
(IMPLIES (AND (NOT (ZEROP Y))
(NOT (LESSP X Y))
(p (DIFFERENCE X Y) Y))
(p X Y))).
Linear arithmetic, the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP, and the
definition of ZEROP can be used to show that the measure (COUNT X) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme produces three new goals:
Case 3. (IMPLIES (AND (ZEROP Y) (NUMBERP X))
(EQUAL (PLUS (REMAINDER X Y)
(TIMES Y (QUOTIENT X Y)))
X)),
which simplifies, applying COMMUTATIVITY-OF-PLUS, TIMES-ZERO, and
COMMUTATIVITY-OF-TIMES, and unfolding the functions ZEROP, EQUAL, REMAINDER,
QUOTIENT, TIMES, and PLUS, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP Y))
(LESSP X Y)
(NUMBERP X))
(EQUAL (PLUS (REMAINDER X Y)
(TIMES Y (QUOTIENT X Y)))
X)).
This simplifies, rewriting with the lemmas COMMUTATIVITY-OF-TIMES and
COMMUTATIVITY-OF-PLUS, and opening up the functions ZEROP, REMAINDER,
QUOTIENT, EQUAL, TIMES, and PLUS, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP Y))
(NOT (LESSP X Y))
(EQUAL (PLUS (REMAINDER (DIFFERENCE X Y) Y)
(TIMES Y
(QUOTIENT (DIFFERENCE X Y) Y)))
(DIFFERENCE X Y))
(NUMBERP X))
(EQUAL (PLUS (REMAINDER X Y)
(TIMES Y (QUOTIENT X Y)))
X)).
This simplifies, rewriting with TIMES-ADD1 and COMMUTATIVITY2-OF-PLUS, and
opening up the functions ZEROP, REMAINDER, and QUOTIENT, to the goal:
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP X Y))
(EQUAL (PLUS (REMAINDER (DIFFERENCE X Y) Y)
(TIMES Y
(QUOTIENT (DIFFERENCE X Y) Y)))
(DIFFERENCE X Y))
(NUMBERP X))
(EQUAL (PLUS Y (DIFFERENCE X Y)) X)).
But this again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
PLUS-REMAINDER-TIMES-QUOTIENT
(DISABLE PLUS-REMAINDER-TIMES-QUOTIENT)
[ 0.0 0.0 0.0 ]
PLUS-REMAINDER-TIMES-QUOTIENT-OFF
(LEMMA REMAINDER-QUOTIENT-ELIM
(ELIM)
(IMPLIES (AND (NOT (ZEROP Y)) (NUMBERP X))
(EQUAL (PLUS (REMAINDER X Y)
(TIMES Y (QUOTIENT X Y)))
X))
((ENABLE PLUS-REMAINDER-TIMES-QUOTIENT)))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP X))
(EQUAL (PLUS (REMAINDER X Y)
(TIMES Y (QUOTIENT X Y)))
X)),
which simplifies, rewriting with PLUS-REMAINDER-TIMES-QUOTIENT, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-QUOTIENT-ELIM
(LEMMA REMAINDER-ADD1
(REWRITE)
(IMPLIES (EQUAL (REMAINDER A B) 0)
(EQUAL (REMAINDER (ADD1 A) B)
(REMAINDER 1 B)))
((ENABLE REMAINDER-NOOP)
(ENABLE-THEORY ADDITION)
(INDUCT (REMAINDER A B))))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to three new goals:
Case 3. (IMPLIES (AND (ZEROP B)
(EQUAL (REMAINDER A B) 0))
(EQUAL (REMAINDER (ADD1 A) B)
(REMAINDER 1 B))),
which simplifies, applying the lemma SUB1-TYPE-RESTRICTION, and unfolding
the functions ZEROP, EQUAL, REMAINDER, ADD1, and NUMBERP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(LESSP A B)
(EQUAL (REMAINDER A B) 0))
(EQUAL (REMAINDER (ADD1 A) B)
(REMAINDER 1 B))),
which simplifies, using linear arithmetic, rewriting with REMAINDER-NOOP,
DIFFERENCE-LEQ-ARG1, and SUB1-TYPE-RESTRICTION, and expanding the functions
ADD1, NUMBERP, and REMAINDER, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(IMPLIES (EQUAL (REMAINDER (DIFFERENCE A B) B)
0)
(EQUAL (REMAINDER (ADD1 (DIFFERENCE A B)) B)
(REMAINDER 1 B)))
(EQUAL (REMAINDER A B) 0))
(EQUAL (REMAINDER (ADD1 A) B)
(REMAINDER 1 B))).
This simplifies, using linear arithmetic, appealing to the lemmas
REMAINDER-NOOP and DIFFERENCE-LEQ-ARG1, and opening up the definitions of
NUMBERP, REMAINDER, and IMPLIES, to the following two new conjectures:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(NOT (LESSP 1 B))
(EQUAL (REMAINDER (ADD1 (DIFFERENCE A B)) B)
0)
(EQUAL (REMAINDER (DIFFERENCE A B) B)
0))
(EQUAL (REMAINDER (ADD1 A) B) 0)).
But this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (EQUAL 1 0))
(NUMBERP 1)
(NOT (LESSP A 1))
(NOT (LESSP 1 1))
(EQUAL (REMAINDER (ADD1 (DIFFERENCE A 1)) 1)
0)
(EQUAL (REMAINDER (DIFFERENCE A 1) 1)
0))
(EQUAL (REMAINDER (ADD1 A) 1) 0)).
This again simplifies, rewriting with DIFFERENCE-ADD1-ARG2, SUB1-ADD1, and
SUB1-TYPE-RESTRICTION, and expanding EQUAL, NUMBERP, LESSP, DIFFERENCE,
SUB1, REMAINDER, and ADD1, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(LESSP 1 B)
(EQUAL (REMAINDER (ADD1 (DIFFERENCE A B)) B)
1)
(EQUAL (REMAINDER (DIFFERENCE A B) B)
0))
(EQUAL (REMAINDER (ADD1 A) B) 1)).
Appealing to the lemma DIFFERENCE-ELIM, we now replace A by (PLUS B X) to
eliminate (DIFFERENCE A B). We rely upon the type restriction lemma noted
when DIFFERENCE was introduced to constrain the new variable. This
generates two new conjectures:
Case 1.1.2.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(LESSP 1 B)
(EQUAL (REMAINDER (ADD1 (DIFFERENCE A B)) B)
1)
(EQUAL (REMAINDER (DIFFERENCE A B) B)
0))
(EQUAL (REMAINDER (ADD1 A) B) 1)),
which further simplifies, expanding LESSP, to:
T.
Case 1.1.1.
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (PLUS B X) B))
(LESSP 1 B)
(EQUAL (REMAINDER (ADD1 X) B) 1)
(EQUAL (REMAINDER X B) 0))
(EQUAL (REMAINDER (ADD1 (PLUS B X)) B)
1)),
which further simplifies, applying CORRECTNESS-OF-CANCEL-LESSP-PLUS,
DIFFERENCE-SUB1-ARG2, CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and
SUB1-ADD1, and opening up FIX, DIFFERENCE, LESSP, and REMAINDER, to the
new goal:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL B 0))
(NUMBERP B)
(LESSP 1 B)
(EQUAL (REMAINDER (ADD1 X) B) 1)
(EQUAL (REMAINDER X B) 0)
(LESSP (PLUS B X) (SUB1 B)))
(EQUAL (ADD1 (PLUS B X)) 1)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.2 0.0 ]
REMAINDER-ADD1
(LEMMA REMAINDER-PLUS-PROOF NIL
(IMPLIES (EQUAL (REMAINDER B C) 0)
(EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER A C)))
((ENABLE REMAINDER-NOOP)
(ENABLE-THEORY ADDITION)
(INDUCT (REMAINDER B C))))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to three new formulas:
Case 3. (IMPLIES (AND (ZEROP C)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER A C))),
which simplifies, applying PLUS-ZERO-ARG2, and opening up the definitions of
ZEROP, EQUAL, and REMAINDER, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER A C))).
This simplifies, applying REMAINDER-NOOP and PLUS-ZERO-ARG2, and unfolding
the definition of ZEROP, to two new formulas:
Case 2.2.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(EQUAL B 0)
(NOT (NUMBERP A)))
(EQUAL (REMAINDER 0 C)
(REMAINDER A C))),
which again simplifies, rewriting with REMAINDER-NOOP, and expanding the
functions EQUAL, LESSP, and NUMBERP, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(NOT (NUMBERP B))
(NOT (NUMBERP A)))
(EQUAL (REMAINDER 0 C)
(REMAINDER A C))).
This again simplifies, using linear arithmetic, rewriting with
REMAINDER-NOOP, and unfolding the functions LESSP, NUMBERP, and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(IMPLIES (EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(EQUAL (REMAINDER (PLUS A (DIFFERENCE B C))
C)
(REMAINDER A C)))
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER A C))).
This simplifies, using linear arithmetic, rewriting with the lemmas
PLUS-ZERO-ARG2, PLUS-DIFFERENCE-ARG2, REMAINDER-NOOP, and
DIFFERENCE-LEQ-ARG1, and opening up the definitions of ZEROP, IMPLIES,
REMAINDER, NUMBERP, and EQUAL, to the following three new goals:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(LESSP C B)
(EQUAL (REMAINDER (DIFFERENCE (PLUS A B) C)
C)
(REMAINDER A C))
(EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(LESSP (PLUS A B) C))
(EQUAL (PLUS A B) (REMAINDER A C))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(EQUAL (REMAINDER 0 C)
(REMAINDER A C)))
(EQUAL (REMAINDER (PLUS A B) C) 0)),
which again simplifies, using linear arithmetic, to two new formulas:
Case 1.2.2.
(IMPLIES (AND (NOT (NUMBERP B))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(EQUAL (REMAINDER 0 C)
(REMAINDER A C)))
(EQUAL (REMAINDER (PLUS A B) C) 0)),
which again simplifies, unfolding the function LESSP, to:
T.
Case 1.2.1.
(IMPLIES (AND (NUMBERP B)
(NOT (EQUAL B 0))
(NOT (LESSP B B))
(NOT (LESSP B B))
(EQUAL (REMAINDER 0 B)
(REMAINDER A B)))
(EQUAL (REMAINDER (PLUS A B) B) 0)),
which again simplifies, using linear arithmetic, appealing to the lemmas
REMAINDER-NOOP, CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and
CORRECTNESS-OF-CANCEL-LESSP-PLUS, and expanding the functions NUMBERP,
FIX, and REMAINDER, to:
(IMPLIES (AND (NUMBERP B)
(NOT (EQUAL B 0))
(NOT (LESSP B B))
(EQUAL 0 (REMAINDER A B))
(NOT (NUMBERP A)))
(EQUAL (REMAINDER 0 B) 0)).
However this again simplifies, using linear arithmetic, applying the
lemma REMAINDER-NOOP, and unfolding EQUAL and NUMBERP, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(NUMBERP A))
(EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER A C))),
which again simplifies, using linear arithmetic, to two new conjectures:
Case 1.1.2.
(IMPLIES (AND (NOT (NUMBERP B))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(NUMBERP A))
(EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER A C))),
which again simplifies, unfolding LESSP, to:
T.
Case 1.1.1.
(IMPLIES (AND (NUMBERP B)
(NOT (EQUAL B 0))
(NOT (LESSP B B))
(NOT (LESSP B B))
(NUMBERP A))
(EQUAL (REMAINDER (PLUS A B) B)
(REMAINDER A B))),
which again simplifies, applying CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS
and CORRECTNESS-OF-CANCEL-LESSP-PLUS, and expanding the functions FIX
and REMAINDER, to:
T.
Q.E.D.
[ 0.0 0.4 0.0 ]
REMAINDER-PLUS-PROOF
(LEMMA REMAINDER-PLUS
(REWRITE)
(IMPLIES (EQUAL (REMAINDER A C) 0)
(AND (EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER B C))
(EQUAL (REMAINDER (PLUS B A) C)
(REMAINDER B C))
(EQUAL (REMAINDER (PLUS X Y A) C)
(REMAINDER (PLUS X Y) C))))
((USE (REMAINDER-PLUS-PROOF (A B)
(B A)
(C C))
(REMAINDER-PLUS-PROOF (A A)
(B B)
(C C))
(REMAINDER-PLUS-PROOF (B A)
(A (PLUS X Y))
(C C)))
(ENABLE COMMUTATIVITY-OF-PLUS COMMUTATIVITY2-OF-PLUS
ASSOCIATIVITY-OF-PLUS)))
WARNING: Note that the proposed lemma REMAINDER-PLUS is to be stored as zero
type prescription rules, zero compound recognizer rules, zero linear rules,
and three replacement rules.
This conjecture can be simplified, using the abbreviations IMPLIES, AND, and
ASSOCIATIVITY-OF-PLUS, to the conjecture:
(IMPLIES (AND (IMPLIES (EQUAL (REMAINDER A C) 0)
(EQUAL (REMAINDER (PLUS B A) C)
(REMAINDER B C)))
(IMPLIES (EQUAL (REMAINDER B C) 0)
(EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER A C)))
(IMPLIES (EQUAL (REMAINDER A C) 0)
(EQUAL (REMAINDER (PLUS X Y A) C)
(REMAINDER (PLUS X Y) C)))
(EQUAL (REMAINDER A C) 0))
(AND (EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER B C))
(EQUAL (REMAINDER (PLUS B A) C)
(REMAINDER B C))
(EQUAL (REMAINDER (PLUS X Y A) C)
(REMAINDER (PLUS X Y) C)))).
This simplifies, appealing to the lemmas COMMUTATIVITY-OF-PLUS and
COMMUTATIVITY2-OF-PLUS, and unfolding the functions EQUAL, IMPLIES, and AND,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-PLUS
(LEMMA EQUAL-REMAINDER-PLUS-0-PROOF NIL
(IMPLIES (EQUAL (REMAINDER A C) 0)
(EQUAL (EQUAL (REMAINDER (PLUS A B) C) 0)
(EQUAL (REMAINDER B C) 0)))
((ENABLE REMAINDER-PLUS)))
This conjecture simplifies, applying REMAINDER-PLUS, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-REMAINDER-PLUS-0-PROOF
(LEMMA EQUAL-REMAINDER-PLUS-0
(REWRITE)
(IMPLIES (EQUAL (REMAINDER A C) 0)
(AND (EQUAL (EQUAL (REMAINDER (PLUS A B) C) 0)
(EQUAL (REMAINDER B C) 0))
(EQUAL (EQUAL (REMAINDER (PLUS B A) C) 0)
(EQUAL (REMAINDER B C) 0))
(EQUAL (EQUAL (REMAINDER (PLUS X Y A) C) 0)
(EQUAL (REMAINDER (PLUS X Y) C) 0))))
((USE (EQUAL-REMAINDER-PLUS-0-PROOF (A A)
(B B)
(C C))
(EQUAL-REMAINDER-PLUS-0-PROOF (A B)
(B A)
(C C))
(EQUAL-REMAINDER-PLUS-0-PROOF (A A)
(B (PLUS X Y))
(C C)))
(ENABLE ASSOCIATIVITY-OF-PLUS COMMUTATIVITY-OF-PLUS
COMMUTATIVITY2-OF-PLUS)
(DO-NOT-INDUCT T)))
WARNING: Note that the proposed lemma EQUAL-REMAINDER-PLUS-0 is to be stored
as zero type prescription rules, zero compound recognizer rules, zero linear
rules, and three replacement rules.
This formula simplifies, applying COMMUTATIVITY-OF-PLUS and
COMMUTATIVITY2-OF-PLUS, and expanding EQUAL, IMPLIES, and AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-REMAINDER-PLUS-0
(LEMMA EQUAL-REMAINDER-PLUS-REMAINDER-PROOF NIL
(IMPLIES (LESSP A C)
(EQUAL (EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER B C))
(ZEROP A)))
((ENABLE REMAINDER-NOOP)
(ENABLE-THEORY ADDITION)
(INDUCT (REMAINDER B C))))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to three new formulas:
Case 3. (IMPLIES (AND (ZEROP C) (LESSP A C))
(EQUAL (EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER B C))
(ZEROP A))),
which simplifies, expanding the functions ZEROP, EQUAL, and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(LESSP A C))
(EQUAL (EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER B C))
(ZEROP A))),
which simplifies, using linear arithmetic, applying the lemma REMAINDER-NOOP,
and unfolding the definitions of REMAINDER and ZEROP, to 12 new formulas:
Case 2.12.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(LESSP A C)
(NUMBERP B)
(LESSP (PLUS A B) C)
(NOT (EQUAL (PLUS A B) B)))
(NUMBERP A)),
which again simplifies, unfolding the definitions of LESSP and PLUS, to:
T.
Case 2.11.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(LESSP A C)
(NUMBERP B)
(LESSP (PLUS A B) C)
(NOT (EQUAL (PLUS A B) B)))
(NOT (EQUAL A 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.10.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(LESSP A C)
(NUMBERP B)
(LESSP (PLUS A B) C)
(EQUAL (PLUS A B) B)
(NOT (EQUAL A 0)))
(NOT (NUMBERP A))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.9.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(LESSP A C)
(NUMBERP B)
(NOT (LESSP (PLUS A B) C))
(NOT (EQUAL (DIFFERENCE (PLUS A B) C) B)))
(NUMBERP A)),
which again simplifies, opening up the functions LESSP and PLUS, to:
T.
Case 2.8.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(LESSP A C)
(NUMBERP B)
(NOT (LESSP (PLUS A B) C))
(NOT (EQUAL (DIFFERENCE (PLUS A B) C) B)))
(NOT (EQUAL A 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.7.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(LESSP A C)
(NUMBERP B)
(NOT (LESSP (PLUS A B) C))
(EQUAL (DIFFERENCE (PLUS A B) C) B)
(NOT (EQUAL A 0)))
(NOT (NUMBERP A))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.6.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(LESSP A C)
(NOT (NUMBERP B))
(LESSP (PLUS A B) C)
(NOT (EQUAL (PLUS A B) 0)))
(NUMBERP A)),
which again simplifies, rewriting with the lemma PLUS-ZERO-ARG2, and
opening up LESSP, ZEROP, and EQUAL, to:
T.
Case 2.5.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(LESSP A C)
(NOT (NUMBERP B))
(LESSP (PLUS A B) C)
(NOT (EQUAL (PLUS A B) 0)))
(NOT (EQUAL A 0))),
which again simplifies, rewriting with the lemma PLUS-ZERO-ARG2, and
expanding LESSP, EQUAL, ZEROP, and NUMBERP, to:
T.
Case 2.4.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(LESSP A C)
(NOT (NUMBERP B))
(LESSP (PLUS A B) C)
(EQUAL (PLUS A B) 0)
(NOT (EQUAL A 0)))
(NOT (NUMBERP A))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(LESSP A C)
(NOT (NUMBERP B))
(NOT (LESSP (PLUS A B) C))
(NOT (EQUAL (DIFFERENCE (PLUS A B) C) 0)))
(NUMBERP A)),
which again simplifies, appealing to the lemma PLUS-ZERO-ARG2, and
expanding the functions LESSP, ZEROP, and EQUAL, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(LESSP A C)
(NOT (NUMBERP B))
(NOT (LESSP (PLUS A B) C))
(NOT (EQUAL (DIFFERENCE (PLUS A B) C) 0)))
(NOT (EQUAL A 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(LESSP A C)
(NOT (NUMBERP B))
(NOT (LESSP (PLUS A B) C))
(EQUAL (DIFFERENCE (PLUS A B) C) 0)
(NOT (EQUAL A 0)))
(NOT (NUMBERP A))),
which again simplifies, applying the lemma PLUS-ZERO-ARG2, and unfolding
LESSP and ZEROP, to:
T.
Case 1. (IMPLIES
(AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(IMPLIES (LESSP A C)
(EQUAL (EQUAL (REMAINDER (PLUS A (DIFFERENCE B C))
C)
(REMAINDER (DIFFERENCE B C) C))
(ZEROP A)))
(LESSP A C))
(EQUAL (EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER B C))
(ZEROP A))),
which simplifies, using linear arithmetic, applying PLUS-ZERO-ARG2,
PLUS-DIFFERENCE-ARG2, REMAINDER-NOOP, and DIFFERENCE-LEQ-ARG1, and expanding
the functions ZEROP, IMPLIES, REMAINDER, EQUAL, LESSP, PLUS, and NUMBERP, to
the following ten new formulas:
Case 1.10.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(LESSP C B)
(NOT (EQUAL (REMAINDER (DIFFERENCE (PLUS A B) C)
C)
(REMAINDER (DIFFERENCE B C) C)))
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP A C))
(NOT (EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER (DIFFERENCE B C) C)))).
However this again simplifies, expanding the definition of REMAINDER, to
the conjecture:
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(LESSP C B)
(NOT (EQUAL (REMAINDER (DIFFERENCE (PLUS A B) C)
C)
(REMAINDER (DIFFERENCE B C) C)))
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP A C)
(LESSP (PLUS A B) C))
(NOT (EQUAL (PLUS A B)
(REMAINDER (DIFFERENCE B C) C)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.9.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(LESSP C B)
(EQUAL (REMAINDER (DIFFERENCE (PLUS A B) C)
C)
(REMAINDER (DIFFERENCE B C) C))
(EQUAL A 0)
(NOT (NUMBERP B)))
(EQUAL (REMAINDER 0 C)
(REMAINDER (DIFFERENCE B C) C))),
which again simplifies, opening up the definition of LESSP, to:
T.
Case 1.8.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(LESSP C B)
(EQUAL (REMAINDER (DIFFERENCE (PLUS A B) C)
C)
(REMAINDER (DIFFERENCE B C) C))
(EQUAL A 0)
(NUMBERP B))
(EQUAL (REMAINDER B C)
(REMAINDER (DIFFERENCE B C) C))),
which again simplifies, expanding the functions EQUAL, PLUS, and REMAINDER,
to:
T.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(LESSP C B)
(EQUAL (REMAINDER (DIFFERENCE (PLUS A B) C)
C)
(REMAINDER (DIFFERENCE B C) C))
(NOT (NUMBERP A))
(NOT (NUMBERP B)))
(EQUAL (REMAINDER 0 C)
(REMAINDER (DIFFERENCE B C) C))),
which again simplifies, expanding the function LESSP, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(LESSP C B)
(EQUAL (REMAINDER (DIFFERENCE (PLUS A B) C)
C)
(REMAINDER (DIFFERENCE B C) C))
(NOT (NUMBERP A))
(NUMBERP B))
(EQUAL (REMAINDER B C)
(REMAINDER (DIFFERENCE B C) C))),
which again simplifies, expanding the definitions of PLUS and REMAINDER,
to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(NUMBERP A)
(NOT (EQUAL (REMAINDER A C)
(REMAINDER (DIFFERENCE B C) C)))
(NOT (EQUAL A 0))
(LESSP A C))
(NOT (EQUAL (REMAINDER (PLUS A B) C) 0))),
which again simplifies, using linear arithmetic, to two new formulas:
Case 1.5.2.
(IMPLIES (AND (NOT (NUMBERP B))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(NUMBERP A)
(NOT (EQUAL (REMAINDER A C)
(REMAINDER (DIFFERENCE B C) C)))
(NOT (EQUAL A 0))
(LESSP A C))
(NOT (EQUAL (REMAINDER (PLUS A B) C) 0))),
which again simplifies, expanding LESSP, to:
T.
Case 1.5.1.
(IMPLIES (AND (NUMBERP B)
(NOT (EQUAL B 0))
(NOT (LESSP B B))
(NOT (LESSP B B))
(NUMBERP A)
(NOT (EQUAL (REMAINDER A B)
(REMAINDER (DIFFERENCE B B) B)))
(NOT (EQUAL A 0))
(LESSP A B))
(NOT (EQUAL (REMAINDER (PLUS A B) B) 0))),
which again simplifies, using linear arithmetic, rewriting with
REMAINDER-NOOP, DIFFERENCE-X-X, CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS,
and CORRECTNESS-OF-CANCEL-LESSP-PLUS, and unfolding the definitions of
NUMBERP, FIX, and REMAINDER, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(NUMBERP A)
(EQUAL (REMAINDER A C)
(REMAINDER (DIFFERENCE B C) C))
(EQUAL A 0)
(NOT (NUMBERP B)))
(EQUAL (REMAINDER 0 C) 0)).
However this again simplifies, expanding the definition of LESSP, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(NUMBERP A)
(EQUAL (REMAINDER A C)
(REMAINDER (DIFFERENCE B C) C))
(EQUAL A 0)
(NUMBERP B))
(EQUAL (REMAINDER B C) 0)),
which again simplifies, using linear arithmetic, to the formula:
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP B B))
(NOT (LESSP B B))
(NUMBERP 0)
(EQUAL (REMAINDER 0 B)
(REMAINDER (DIFFERENCE B B) B))
(NUMBERP B))
(EQUAL (REMAINDER B B) 0)).
However this again simplifies, applying REMAINDER-NOOP and DIFFERENCE-X-X,
and unfolding the functions NUMBERP, LESSP, EQUAL, and REMAINDER, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(NOT (NUMBERP A))
(EQUAL (REMAINDER 0 C)
(REMAINDER (DIFFERENCE B C) C))
(NOT (NUMBERP B)))
(EQUAL (REMAINDER 0 C) 0)).
But this again simplifies, unfolding the function LESSP, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(NOT (NUMBERP A))
(EQUAL (REMAINDER 0 C)
(REMAINDER (DIFFERENCE B C) C))
(NUMBERP B))
(EQUAL (REMAINDER B C) 0)),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP B B))
(NOT (LESSP B B))
(NOT (NUMBERP A))
(EQUAL (REMAINDER 0 B)
(REMAINDER (DIFFERENCE B B) B))
(NUMBERP B))
(EQUAL (REMAINDER B B) 0)).
But this again simplifies, applying REMAINDER-NOOP and DIFFERENCE-X-X, and
expanding LESSP, EQUAL, NUMBERP, and REMAINDER, to:
T.
Q.E.D.
[ 0.0 0.3 0.1 ]
EQUAL-REMAINDER-PLUS-REMAINDER-PROOF
(LEMMA EQUAL-REMAINDER-PLUS-REMAINDER
(REWRITE)
(IMPLIES (LESSP A C)
(AND (EQUAL (EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER B C))
(ZEROP A))
(EQUAL (EQUAL (REMAINDER (PLUS B A) C)
(REMAINDER B C))
(ZEROP A))))
((USE (EQUAL-REMAINDER-PLUS-REMAINDER-PROOF (A A)
(B B)
(C C)))
(ENABLE COMMUTATIVITY-OF-PLUS)
(DO-NOT-INDUCT T)))
WARNING: Note that the proposed lemma EQUAL-REMAINDER-PLUS-REMAINDER is to be
stored as zero type prescription rules, zero compound recognizer rules, zero
linear rules, and two replacement rules.
This conjecture simplifies, applying COMMUTATIVITY-OF-PLUS, and expanding
ZEROP, IMPLIES, LESSP, PLUS, AND, and EQUAL, to the following two new formulas:
Case 2. (IMPLIES (AND (EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER B C))
(NOT (NUMBERP A))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (NUMBERP B)))
(EQUAL (REMAINDER 0 C)
(REMAINDER B C))).
This again simplifies, unfolding the definitions of PLUS, NUMBERP, LESSP,
EQUAL, and REMAINDER, to:
T.
Case 1. (IMPLIES (AND (EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER B C))
(EQUAL A 0)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (NUMBERP B)))
(EQUAL (REMAINDER 0 C)
(REMAINDER B C))),
which again simplifies, expanding the functions EQUAL, PLUS, NUMBERP, LESSP,
and REMAINDER, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-REMAINDER-PLUS-REMAINDER
(DISABLE EQUAL-REMAINDER-PLUS-REMAINDER)
[ 0.0 0.0 0.0 ]
EQUAL-REMAINDER-PLUS-REMAINDER-OFF
(LEMMA REMAINDER-TIMES1-PROOF NIL
(IMPLIES (EQUAL (REMAINDER B C) 0)
(EQUAL (REMAINDER (TIMES A B) C) 0))
((ENABLE-THEORY MULTIPLICATION ADDITION)
(ENABLE REMAINDER-PLUS REMAINDER-NOOP REMAINDER-ZERO)))
Name the conjecture *1.
We will try to prove it by induction. Two inductions are suggested by
terms in the conjecture. However, only one is unflawed. We will induct
according to the following scheme:
(AND (IMPLIES (ZEROP A) (p A B C))
(IMPLIES (AND (NOT (ZEROP A)) (p (SUB1 A) B C))
(p A B C))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT A) decreases according to the well-founded
relation LESSP in each induction step of the scheme. The above induction
scheme generates two new conjectures:
Case 2. (IMPLIES (AND (ZEROP A)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER (TIMES A B) C) 0)),
which simplifies, opening up ZEROP, EQUAL, TIMES, LESSP, NUMBERP, and
REMAINDER, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP A))
(EQUAL (REMAINDER (TIMES (SUB1 A) B) C)
0)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER (TIMES A B) C) 0)),
which simplifies, rewriting with REMAINDER-PLUS, and unfolding the
definitions of ZEROP, TIMES, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.3 0.0 ]
REMAINDER-TIMES1-PROOF
(LEMMA REMAINDER-TIMES1
(REWRITE)
(IMPLIES (EQUAL (REMAINDER B C) 0)
(AND (EQUAL (REMAINDER (TIMES A B) C) 0)
(EQUAL (REMAINDER (TIMES B A) C) 0)))
((USE (REMAINDER-TIMES1-PROOF (A A)
(B B)
(C C))
(REMAINDER-TIMES1-PROOF (A B)
(B A)
(C C)))
(ENABLE COMMUTATIVITY-OF-TIMES)))
WARNING: Note that the proposed lemma REMAINDER-TIMES1 is to be stored as
zero type prescription rules, zero compound recognizer rules, zero linear
rules, and two replacement rules.
This conjecture simplifies, applying the lemma COMMUTATIVITY-OF-TIMES, and
expanding the functions EQUAL, IMPLIES, and AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-TIMES1
(LEMMA REMAINDER-TIMES1-INSTANCE-PROOF NIL
(EQUAL (REMAINDER (TIMES X Y) Y) 0)
((ENABLE COMMUTATIVITY-OF-TIMES DIFFERENCE-PLUS-CANCELLATION
REMAINDER-ZERO)
(INDUCT (TIMES X Y))))
This formula can be simplified, using the abbreviations ZEROP, NOT, OR, and
AND, to the following two new conjectures:
Case 2. (IMPLIES (ZEROP X)
(EQUAL (REMAINDER (TIMES X Y) Y) 0)).
This simplifies, opening up ZEROP, EQUAL, TIMES, LESSP, NUMBERP, and
REMAINDER, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (REMAINDER (TIMES (SUB1 X) Y) Y)
0))
(EQUAL (REMAINDER (TIMES X Y) Y) 0)).
This simplifies, applying COMMUTATIVITY-OF-TIMES and
DIFFERENCE-PLUS-CANCELLATION, and unfolding TIMES and REMAINDER, to three
new conjectures:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (REMAINDER (TIMES Y (SUB1 X)) Y)
0)
(NOT (NUMBERP Y)))
(EQUAL (PLUS Y (TIMES Y (SUB1 X)))
0)),
which again simplifies, applying REMAINDER-ZERO, and opening up the
definitions of TIMES, ZEROP, NUMBERP, EQUAL, and PLUS, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (REMAINDER (TIMES Y (SUB1 X)) Y)
0)
(EQUAL Y 0))
(EQUAL (PLUS Y (TIMES Y (SUB1 X)))
0)).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (REMAINDER (TIMES Y (SUB1 X)) Y)
0)
(LESSP (PLUS Y (TIMES Y (SUB1 X))) Y))
(EQUAL (PLUS Y (TIMES Y (SUB1 X)))
0)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-TIMES1-INSTANCE-PROOF
(LEMMA REMAINDER-TIMES1-INSTANCE
(REWRITE)
(AND (EQUAL (REMAINDER (TIMES X Y) Y) 0)
(EQUAL (REMAINDER (TIMES X Y) X) 0))
((USE (REMAINDER-TIMES1-INSTANCE-PROOF (X X)
(Y Y))
(REMAINDER-TIMES1-INSTANCE-PROOF (X Y)
(Y X)))
(ENABLE COMMUTATIVITY-OF-TIMES)))
WARNING: Note that the proposed lemma REMAINDER-TIMES1-INSTANCE is to be
stored as zero type prescription rules, zero compound recognizer rules, zero
linear rules, and two replacement rules.
This formula simplifies, rewriting with the lemma COMMUTATIVITY-OF-TIMES, and
unfolding the definitions of EQUAL and AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-TIMES1-INSTANCE
(LEMMA REMAINDER-TIMES-TIMES-PROOF NIL
(EQUAL (REMAINDER (TIMES X Y) (TIMES X Z))
(TIMES X (REMAINDER Y Z)))
((ENABLE-THEORY ADDITION MULTIPLICATION)
(ENABLE REMAINDER-ZERO)
(INDUCT (REMAINDER Y Z))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, OR, and
AND, to three new formulas:
Case 3. (IMPLIES (ZEROP Z)
(EQUAL (REMAINDER (TIMES X Y) (TIMES X Z))
(TIMES X (REMAINDER Y Z)))),
which simplifies, applying COMMUTATIVITY-OF-TIMES, REMAINDER-ZERO,
CORRECTNESS-OF-CANCEL-EQUAL-TIMES, and TIMES-ZERO, and expanding ZEROP,
EQUAL, TIMES, FIX, and OR, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL Z 0))
(NUMBERP Z)
(LESSP Y Z))
(EQUAL (REMAINDER (TIMES X Y) (TIMES X Z))
(TIMES X (REMAINDER Y Z)))).
This simplifies, unfolding the function REMAINDER, to the following two new
conjectures:
Case 2.2.
(IMPLIES (AND (NOT (EQUAL Z 0))
(NUMBERP Z)
(LESSP Y Z)
(NOT (NUMBERP Y)))
(EQUAL (REMAINDER (TIMES X Y) (TIMES X Z))
(TIMES X 0))).
But this again simplifies, appealing to the lemmas TIMES-ZERO,
EQUAL-TIMES-0, and COMMUTATIVITY-OF-TIMES, and unfolding LESSP, ZEROP,
EQUAL, NUMBERP, REMAINDER, and TIMES, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL Z 0))
(NUMBERP Z)
(LESSP Y Z)
(NUMBERP Y))
(EQUAL (REMAINDER (TIMES X Y) (TIMES X Z))
(TIMES X Y))),
which again simplifies, applying CORRECTNESS-OF-CANCEL-LESSP-TIMES and
EQUAL-TIMES-0, and expanding AND, FIX, NOT, ZEROP, and REMAINDER, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y Z))
(EQUAL (REMAINDER (TIMES X (DIFFERENCE Y Z))
(TIMES X Z))
(TIMES X
(REMAINDER (DIFFERENCE Y Z) Z))))
(EQUAL (REMAINDER (TIMES X Y) (TIMES X Z))
(TIMES X (REMAINDER Y Z)))).
This simplifies, applying TIMES-DISTRIBUTES-OVER-DIFFERENCE,
CORRECTNESS-OF-CANCEL-LESSP-TIMES, and EQUAL-TIMES-0, and unfolding the
definitions of AND, FIX, NOT, ZEROP, and REMAINDER, to three new formulas:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y Z))
(EQUAL (REMAINDER (DIFFERENCE (TIMES X Y) (TIMES X Z))
(TIMES X Z))
(TIMES X
(REMAINDER (DIFFERENCE Y Z) Z)))
(EQUAL X 0))
(EQUAL (TIMES X Y)
(TIMES X
(REMAINDER (DIFFERENCE Y Z) Z)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y Z))
(EQUAL (REMAINDER (DIFFERENCE (TIMES X Y) (TIMES X Z))
(TIMES X Z))
(TIMES X
(REMAINDER (DIFFERENCE Y Z) Z)))
(NOT (NUMBERP X)))
(EQUAL (TIMES X Y)
(TIMES X
(REMAINDER (DIFFERENCE Y Z) Z)))),
which again simplifies, unfolding TIMES, DIFFERENCE, REMAINDER, and EQUAL,
to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y Z))
(EQUAL (REMAINDER (DIFFERENCE (TIMES X Y) (TIMES X Z))
(TIMES X Z))
(TIMES X
(REMAINDER (DIFFERENCE Y Z) Z)))
(NOT (NUMBERP Y))
(LESSP 0 Z))
(EQUAL (TIMES X Y)
(TIMES X
(REMAINDER (DIFFERENCE Y Z) Z)))),
which again simplifies, opening up LESSP, to:
T.
Q.E.D.
[ 0.0 0.2 0.0 ]
REMAINDER-TIMES-TIMES-PROOF
(LEMMA REMAINDER-TIMES-TIMES
(REWRITE)
(AND (EQUAL (REMAINDER (TIMES X Y) (TIMES X Z))
(TIMES X (REMAINDER Y Z)))
(EQUAL (REMAINDER (TIMES X Z) (TIMES Y Z))
(TIMES (REMAINDER X Y) Z)))
((USE (REMAINDER-TIMES-TIMES-PROOF (X X)
(Y Y)
(Z Z))
(REMAINDER-TIMES-TIMES-PROOF (X Z)
(Y X)
(Z Y)))
(ENABLE COMMUTATIVITY-OF-TIMES)))
WARNING: Note that the proposed lemma REMAINDER-TIMES-TIMES is to be stored
as zero type prescription rules, zero compound recognizer rules, zero linear
rules, and two replacement rules.
This formula simplifies, applying COMMUTATIVITY-OF-TIMES, and opening up the
definition of AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-TIMES-TIMES
(DISABLE REMAINDER-TIMES-TIMES)
[ 0.0 0.0 0.0 ]
REMAINDER-TIMES-TIMES-OFF
(LEMMA REMAINDER-TIMES2-PROOF NIL
(IMPLIES (EQUAL (REMAINDER A Z) 0)
(EQUAL (REMAINDER A (TIMES Z Y))
(TIMES Z
(REMAINDER (QUOTIENT A Z) Y))))
((ENABLE-THEORY ADDITION MULTIPLICATION)
(ENABLE LESSP-REMAINDER REMAINDER-NOOP REMAINDER-PLUS
REMAINDER-QUOTIENT-ELIM REMAINDER-TIMES-TIMES
REMAINDER-TIMES1-INSTANCE REMAINDER-ZERO)
(DO-NOT-INDUCT T)))
This simplifies, rewriting with COMMUTATIVITY-OF-TIMES, to:
(IMPLIES (EQUAL (REMAINDER A Z) 0)
(EQUAL (REMAINDER A (TIMES Y Z))
(TIMES Z
(REMAINDER (QUOTIENT A Z) Y)))).
Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace A by
(PLUS V (TIMES Z X)) to eliminate (QUOTIENT A Z) and (REMAINDER A Z) and X by
(PLUS W (TIMES Y D)) to eliminate (REMAINDER X Y) and (QUOTIENT X Y). We rely
upon LESSP-REMAINDER, the type restriction lemma noted when REMAINDER was
introduced, and the type restriction lemma noted when QUOTIENT was introduced
to constrain the new variables. The result is six new formulas:
Case 6. (IMPLIES (AND (NOT (NUMBERP A))
(EQUAL (REMAINDER A Z) 0))
(EQUAL (REMAINDER A (TIMES Y Z))
(TIMES Z
(REMAINDER (QUOTIENT A Z) Y)))),
which further simplifies, rewriting with EQUAL-TIMES-0 and
COMMUTATIVITY-OF-TIMES, and expanding LESSP, REMAINDER, EQUAL, QUOTIENT,
NUMBERP, and TIMES, to:
T.
Case 5. (IMPLIES (AND (EQUAL Z 0)
(EQUAL (REMAINDER A Z) 0))
(EQUAL (REMAINDER A (TIMES Y Z))
(TIMES Z
(REMAINDER (QUOTIENT A Z) Y)))).
This further simplifies, appealing to the lemmas REMAINDER-ZERO and
COMMUTATIVITY-OF-TIMES, and opening up ZEROP, EQUAL, TIMES, REMAINDER,
QUOTIENT, LESSP, and NUMBERP, to:
T.
Case 4. (IMPLIES (AND (NOT (NUMBERP Z))
(EQUAL (REMAINDER A Z) 0))
(EQUAL (REMAINDER A (TIMES Y Z))
(TIMES Z
(REMAINDER (QUOTIENT A Z) Y)))),
which further simplifies, applying the lemmas REMAINDER-ZERO, TIMES-ZERO,
and COMMUTATIVITY-OF-TIMES, and expanding the definitions of ZEROP,
REMAINDER, QUOTIENT, LESSP, EQUAL, and NUMBERP, to:
T.
Case 3. (IMPLIES (AND (EQUAL Y 0)
(NUMBERP X)
(NUMBERP V)
(EQUAL (LESSP V Z) (NOT (ZEROP Z)))
(NUMBERP Z)
(NOT (EQUAL Z 0))
(EQUAL V 0))
(EQUAL (REMAINDER (PLUS V (TIMES Z X))
(TIMES Y Z))
(TIMES Z (REMAINDER X Y)))),
which further simplifies, applying COMMUTATIVITY-OF-TIMES and REMAINDER-ZERO,
and expanding NUMBERP, EQUAL, LESSP, ZEROP, NOT, PLUS, and TIMES, to:
T.
Case 2. (IMPLIES (AND (NOT (NUMBERP Y))
(NUMBERP X)
(NUMBERP V)
(EQUAL (LESSP V Z) (NOT (ZEROP Z)))
(NUMBERP Z)
(NOT (EQUAL Z 0))
(EQUAL V 0))
(EQUAL (REMAINDER (PLUS V (TIMES Z X))
(TIMES Y Z))
(TIMES Z (REMAINDER X Y)))).
However this further simplifies, applying COMMUTATIVITY-OF-TIMES and
REMAINDER-ZERO, and expanding the definitions of NUMBERP, EQUAL, LESSP,
ZEROP, NOT, PLUS, and TIMES, to:
T.
Case 1. (IMPLIES (AND (NUMBERP W)
(EQUAL (LESSP W Y) (NOT (ZEROP Y)))
(NUMBERP D)
(NUMBERP Y)
(NOT (EQUAL Y 0))
(NUMBERP V)
(EQUAL (LESSP V Z) (NOT (ZEROP Z)))
(NUMBERP Z)
(NOT (EQUAL Z 0))
(EQUAL V 0))
(EQUAL (REMAINDER (PLUS V
(TIMES Z (PLUS W (TIMES Y D))))
(TIMES Y Z))
(TIMES Z W))).
But this further simplifies, applying COMMUTATIVITY-OF-TIMES,
COMMUTATIVITY2-OF-TIMES, TIMES-DISTRIBUTES-OVER-PLUS,
REMAINDER-TIMES1-INSTANCE, REMAINDER-NOOP, REMAINDER-TIMES-TIMES, and
REMAINDER-PLUS, and expanding ZEROP, NOT, NUMBERP, EQUAL, LESSP, and PLUS,
to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
REMAINDER-TIMES2-PROOF
(LEMMA REMAINDER-TIMES2
(REWRITE)
(IMPLIES (EQUAL (REMAINDER A Z) 0)
(AND (EQUAL (REMAINDER A (TIMES Y Z))
(TIMES Z
(REMAINDER (QUOTIENT A Z) Y)))
(EQUAL (REMAINDER A (TIMES Z Y))
(TIMES Z
(REMAINDER (QUOTIENT A Z) Y)))))
((USE (REMAINDER-TIMES2-PROOF (A A)
(Y Y)
(Z Z)))
(ENABLE COMMUTATIVITY-OF-TIMES)))
WARNING: Note that the proposed lemma REMAINDER-TIMES2 is to be stored as
zero type prescription rules, zero compound recognizer rules, zero linear
rules, and two replacement rules.
This simplifies, applying COMMUTATIVITY-OF-TIMES, and expanding the functions
EQUAL, IMPLIES, and AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-TIMES2
(LEMMA REMAINDER-TIMES2-INSTANCE
(REWRITE)
(AND (EQUAL (REMAINDER (TIMES X Y) (TIMES X Z))
(TIMES X (REMAINDER Y Z)))
(EQUAL (REMAINDER (TIMES X Z) (TIMES Y Z))
(TIMES (REMAINDER X Y) Z)))
((ENABLE REMAINDER-TIMES-TIMES)))
WARNING: Note that the proposed lemma REMAINDER-TIMES2-INSTANCE is to be
stored as zero type prescription rules, zero compound recognizer rules, zero
linear rules, and two replacement rules.
This formula can be simplified, using the abbreviations AND and
REMAINDER-TIMES-TIMES, to the following two new conjectures:
Case 2. (EQUAL (TIMES X (REMAINDER Y Z))
(TIMES X (REMAINDER Y Z))).
This simplifies, trivially, to:
T.
Case 1. (EQUAL (TIMES (REMAINDER X Y) Z)
(TIMES (REMAINDER X Y) Z)).
This simplifies, clearly, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-TIMES2-INSTANCE
(LEMMA REMAINDER-DIFFERENCE1
(REWRITE)
(IMPLIES (EQUAL (REMAINDER A C)
(REMAINDER B C))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(DIFFERENCE (REMAINDER A C)
(REMAINDER B C))))
((ENABLE LESSP-REMAINDER EQUAL-REMAINDER-PLUS-REMAINDER REMAINDER-PLUS
REMAINDER-QUOTIENT-ELIM REMAINDER-TIMES1-INSTANCE)
(ENABLE-THEORY ADDITION)
(DO-NOT-INDUCT T)))
This conjecture simplifies, rewriting with the lemma DIFFERENCE-X-X, to:
(IMPLIES (EQUAL (REMAINDER A C)
(REMAINDER B C))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
0)).
Appealing to the lemmas DIFFERENCE-ELIM and REMAINDER-QUOTIENT-ELIM, we now
replace A by (PLUS B X) to eliminate (DIFFERENCE A B) and X by
(PLUS Z (TIMES C V)) to eliminate (REMAINDER X C) and (QUOTIENT X C). We
employ the type restriction lemma noted when DIFFERENCE was introduced,
LESSP-REMAINDER, the type restriction lemma noted when REMAINDER was
introduced, and the type restriction lemma noted when QUOTIENT was introduced
to constrain the new variables. This generates five new conjectures:
Case 5. (IMPLIES (AND (LESSP A B)
(EQUAL (REMAINDER A C)
(REMAINDER B C)))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
0)),
which further simplifies, using linear arithmetic, rewriting with
DIFFERENCE-LEQ-ARG1, and opening up the functions LESSP, EQUAL, NUMBERP, and
REMAINDER, to:
T.
Case 4. (IMPLIES (AND (NOT (NUMBERP A))
(EQUAL (REMAINDER A C)
(REMAINDER B C)))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
0)).
However this further simplifies, using linear arithmetic, rewriting with
DIFFERENCE-LEQ-ARG1, and expanding LESSP, REMAINDER, EQUAL, and NUMBERP, to:
T.
Case 3. (IMPLIES (AND (EQUAL C 0)
(NUMBERP X)
(NOT (LESSP (PLUS B X) B))
(EQUAL (REMAINDER (PLUS B X) C)
(REMAINDER B C)))
(EQUAL (REMAINDER X C) 0)).
This further simplifies, rewriting with CORRECTNESS-OF-CANCEL-LESSP-PLUS,
and unfolding the functions EQUAL and REMAINDER, to the following two new
goals:
Case 3.2.
(IMPLIES (AND (NUMBERP X)
(NOT (NUMBERP B))
(EQUAL (PLUS B X) 0))
(EQUAL X 0)).
This again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP X)
(NUMBERP B)
(EQUAL (PLUS B X) B))
(EQUAL X 0)),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (NUMBERP C))
(NUMBERP X)
(NOT (LESSP (PLUS B X) B))
(EQUAL (REMAINDER (PLUS B X) C)
(REMAINDER B C)))
(EQUAL (REMAINDER X C) 0)),
which further simplifies, applying CORRECTNESS-OF-CANCEL-LESSP-PLUS, and
opening up REMAINDER, to the following two new goals:
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP C))
(NUMBERP X)
(NOT (NUMBERP B))
(EQUAL (PLUS B X) 0))
(EQUAL X 0)).
This again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP C))
(NUMBERP X)
(NUMBERP B)
(EQUAL (PLUS B X) B))
(EQUAL X 0)),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NUMBERP Z)
(EQUAL (LESSP Z C) (NOT (ZEROP C)))
(NUMBERP V)
(NUMBERP C)
(NOT (EQUAL C 0))
(NOT (LESSP (PLUS B Z (TIMES C V)) B))
(EQUAL (REMAINDER (PLUS B Z (TIMES C V)) C)
(REMAINDER B C)))
(EQUAL Z 0)),
which further simplifies, applying CORRECTNESS-OF-CANCEL-LESSP-PLUS,
REMAINDER-TIMES1-INSTANCE, REMAINDER-PLUS, and
EQUAL-REMAINDER-PLUS-REMAINDER, and unfolding ZEROP, NOT, and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
REMAINDER-DIFFERENCE1
(DEFN DOUBLE-REMAINDER-INDUCTION
(A B C)
(IF (ZEROP C)
0
(IF (LESSP A C)
0
(IF (LESSP B C)
0
(DOUBLE-REMAINDER-INDUCTION (DIFFERENCE A C)
(DIFFERENCE B C)
C)))))
Linear arithmetic, the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP, and the
definition of ZEROP establish that the measure (COUNT A) decreases according
to the well-founded relation LESSP in each recursive call. Hence,
DOUBLE-REMAINDER-INDUCTION
is accepted under the principle of definition. The definition of:
DOUBLE-REMAINDER-INDUCTION
can be justified in another way. Linear arithmetic, the lemmas COUNT-NUMBERP
and COUNT-NOT-LESSP, and the definition of ZEROP inform us that the measure
(COUNT B) decreases according to the well-founded relation LESSP in each
recursive call. Note that (NUMBERP (DOUBLE-REMAINDER-INDUCTION A B C)) is a
theorem.
[ 0.0 0.0 0.0 ]
DOUBLE-REMAINDER-INDUCTION
(LEMMA REMAINDER-DIFFERENCE2
(REWRITE)
(IMPLIES (AND (EQUAL (REMAINDER A C) 0)
(NOT (EQUAL (REMAINDER B C) 0)))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE C (REMAINDER B C))
0)))
((ENABLE EQUAL-REMAINDER-PLUS-0 LESSP-REMAINDER REMAINDER-NOOP
REMAINDER-OF-NON-NUMBER REMAINDER-QUOTIENT-ELIM
REMAINDER-TIMES1-INSTANCE REMAINDER-ZERO)
(DISABLE TIMES-DISTRIBUTES-OVER-PLUS)
(ENABLE-THEORY ADDITION MULTIPLICATION)
(INDUCT (DOUBLE-REMAINDER-INDUCTION A B C))))
This formula can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, AND, and DIFFERENCE-DIFFERENCE-ARG1, to the following four new formulas:
Case 4. (IMPLIES (AND (ZEROP C)
(EQUAL (REMAINDER A C) 0)
(NOT (EQUAL (REMAINDER B C) 0)))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE C (REMAINDER B C))
0))).
This simplifies, using linear arithmetic, appealing to the lemmas
REMAINDER-ZERO and DIFFERENCE-LEQ-ARG1, and unfolding the functions ZEROP,
REMAINDER, EQUAL, LESSP, and NUMBERP, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP A C)
(EQUAL (REMAINDER A C) 0)
(NOT (EQUAL (REMAINDER B C) 0)))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE C (REMAINDER B C))
0))).
This simplifies, using linear arithmetic, rewriting with REMAINDER-NOOP and
DIFFERENCE-LEQ-ARG1, and unfolding the definitions of NUMBERP, EQUAL, and
LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(LESSP B C)
(EQUAL (REMAINDER A C) 0)
(NOT (EQUAL (REMAINDER B C) 0)))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE C (REMAINDER B C))
0))),
which simplifies, applying REMAINDER-NOOP, to the following two new
conjectures:
Case 2.2.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(LESSP B C)
(EQUAL (REMAINDER A C) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(NOT (LESSP B A)))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
0)).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(LESSP B C)
(EQUAL (REMAINDER A C) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(LESSP B A))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(DIFFERENCE C B))).
Applying the lemmas DIFFERENCE-ELIM and REMAINDER-QUOTIENT-ELIM, replace A
by (PLUS B X) to eliminate (DIFFERENCE A B) and X by (PLUS Z (TIMES C V))
to eliminate (REMAINDER X C) and (QUOTIENT X C). We rely upon the type
restriction lemma noted when DIFFERENCE was introduced, LESSP-REMAINDER,
the type restriction lemma noted when REMAINDER was introduced, and the
type restriction lemma noted when QUOTIENT was introduced to restrict the
new variables. This produces the following three new goals:
Case 2.1.3.
(IMPLIES (AND (LESSP A B)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(LESSP B C)
(EQUAL (REMAINDER A C) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(LESSP B A))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(DIFFERENCE C B))).
This further simplifies, using linear arithmetic, to:
T.
Case 2.1.2.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(LESSP B C)
(EQUAL (REMAINDER A C) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(LESSP B A))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(DIFFERENCE C B))),
which further simplifies, opening up the function LESSP, to:
T.
Case 2.1.1.
(IMPLIES (AND (NUMBERP Z)
(EQUAL (LESSP Z C) (NOT (ZEROP C)))
(NUMBERP V)
(NOT (LESSP (PLUS B Z (TIMES C V)) B))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (PLUS B Z (TIMES C V)) C))
(LESSP B C)
(EQUAL (REMAINDER (PLUS B Z (TIMES C V)) C)
0)
(NUMBERP B)
(NOT (EQUAL B 0))
(LESSP B (PLUS B Z (TIMES C V))))
(EQUAL Z (DIFFERENCE C B))),
which further simplifies, applying CORRECTNESS-OF-CANCEL-LESSP-PLUS,
REMAINDER-TIMES1-INSTANCE, EQUAL-REMAINDER-PLUS-0, EQUAL-PLUS-0, and
EQUAL-TIMES-0, and opening up ZEROP, NOT, and EQUAL, to the following
two new formulas:
Case 2.1.1.2.
(IMPLIES (AND (NUMBERP Z)
(LESSP Z C)
(NUMBERP V)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (PLUS B Z (TIMES C V)) C))
(LESSP B C)
(EQUAL (REMAINDER (PLUS B Z) C) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(NOT (EQUAL Z 0)))
(EQUAL Z (DIFFERENCE C B))).
This again simplifies, using linear arithmetic, rewriting with
REMAINDER-NOOP, and expanding the definition of REMAINDER, to the
following two new goals:
Case 2.1.1.2.2.
(IMPLIES (AND (NUMBERP Z)
(LESSP Z C)
(NUMBERP V)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (PLUS B Z (TIMES C V)) C))
(LESSP B C)
(NOT (LESSP (PLUS B Z) C))
(EQUAL (DIFFERENCE (PLUS B Z) C) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(NOT (EQUAL Z 0)))
(EQUAL Z (DIFFERENCE C B))).
However this again simplifies, using linear arithmetic, to the
formula:
(IMPLIES (AND (LESSP C B)
(NUMBERP Z)
(LESSP Z C)
(NUMBERP V)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (PLUS B Z (TIMES C V)) C))
(LESSP B C)
(NOT (LESSP (PLUS B Z) C))
(EQUAL (DIFFERENCE (PLUS B Z) C) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(NOT (EQUAL Z 0)))
(EQUAL Z (DIFFERENCE C B))).
However this finally simplifies, using linear arithmetic, to:
T.
Case 2.1.1.2.1.
(IMPLIES (AND (NUMBERP Z)
(LESSP Z C)
(NUMBERP V)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (PLUS B Z (TIMES C V)) C))
(LESSP B C)
(LESSP (PLUS B Z) C)
(EQUAL (PLUS B Z) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(NOT (EQUAL Z 0)))
(EQUAL Z (DIFFERENCE C B))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.1.1.
(IMPLIES (AND (NUMBERP Z)
(LESSP Z C)
(NUMBERP V)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (PLUS B Z (TIMES C V)) C))
(LESSP B C)
(EQUAL (REMAINDER (PLUS B Z) C) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(NOT (EQUAL V 0)))
(EQUAL Z (DIFFERENCE C B))),
which again simplifies, using linear arithmetic, applying
REMAINDER-NOOP, and opening up the definition of REMAINDER, to the
following two new formulas:
Case 2.1.1.1.2.
(IMPLIES (AND (NUMBERP Z)
(LESSP Z C)
(NUMBERP V)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (PLUS B Z (TIMES C V)) C))
(LESSP B C)
(NOT (LESSP (PLUS B Z) C))
(EQUAL (DIFFERENCE (PLUS B Z) C) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(NOT (EQUAL V 0)))
(EQUAL Z (DIFFERENCE C B))).
However this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP C B)
(NUMBERP Z)
(LESSP Z C)
(NUMBERP V)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (PLUS B Z (TIMES C V)) C))
(LESSP B C)
(NOT (LESSP (PLUS B Z) C))
(EQUAL (DIFFERENCE (PLUS B Z) C) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(NOT (EQUAL V 0)))
(EQUAL Z (DIFFERENCE C B))).
But this finally simplifies, using linear arithmetic, to:
T.
Case 2.1.1.1.1.
(IMPLIES (AND (NUMBERP Z)
(LESSP Z C)
(NUMBERP V)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (PLUS B Z (TIMES C V)) C))
(LESSP B C)
(LESSP (PLUS B Z) C)
(EQUAL (PLUS B Z) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(NOT (EQUAL V 0)))
(EQUAL Z (DIFFERENCE C B))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES
(AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(IMPLIES (AND (EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0)))
(EQUAL (REMAINDER (DIFFERENCE A
(PLUS C (DIFFERENCE B C)))
C)
(IF (LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(DIFFERENCE C
(REMAINDER (DIFFERENCE B C) C))
0)))
(EQUAL (REMAINDER A C) 0)
(NOT (EQUAL (REMAINDER B C) 0)))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE C (REMAINDER B C))
0))),
which simplifies, using linear arithmetic, applying COMMUTATIVITY-OF-PLUS,
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, PLUS-ZERO-ARG2, PLUS-DIFFERENCE-ARG2,
REMAINDER-NOOP, REMAINDER-OF-NON-NUMBER, and DIFFERENCE-LEQ-ARG1, and
unfolding the functions NOT, AND, FIX, ZEROP, IMPLIES, REMAINDER, NUMBERP,
and EQUAL, to the following two new formulas:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(LESSP C B)
(NUMBERP B)
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(DIFFERENCE C
(REMAINDER (DIFFERENCE B C) C)))
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(NOT (LESSP B A)))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
0)).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(NOT (LESSP (DIFFERENCE B C)
(DIFFERENCE A C)))
(NUMBERP B)
(EQUAL (REMAINDER (DIFFERENCE A B) C)
0)
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(LESSP B A))
(EQUAL 0
(DIFFERENCE C
(REMAINDER (DIFFERENCE B C) C)))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.8 0.0 ]
REMAINDER-DIFFERENCE2
(LEMMA REMAINDER-DIFFERENCE3
(REWRITE)
(IMPLIES (AND (EQUAL (REMAINDER B C) 0)
(NOT (EQUAL (REMAINDER A C) 0)))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(IF (LESSP B A) (REMAINDER A C) 0)))
((ENABLE REMAINDER-NOOP REMAINDER-OF-NON-NUMBER REMAINDER-ZERO)
(ENABLE-THEORY ADDITION)
(INDUCT (DOUBLE-REMAINDER-INDUCTION A B C))))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, AND, and DIFFERENCE-DIFFERENCE-ARG1, to four new conjectures:
Case 4. (IMPLIES (AND (ZEROP C)
(EQUAL (REMAINDER B C) 0)
(NOT (EQUAL (REMAINDER A C) 0)))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(IF (LESSP B A) (REMAINDER A C) 0))),
which simplifies, applying REMAINDER-ZERO, and unfolding the definitions of
ZEROP, EQUAL, DIFFERENCE, and LESSP, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP A C)
(EQUAL (REMAINDER B C) 0)
(NOT (EQUAL (REMAINDER A C) 0)))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(IF (LESSP B A) (REMAINDER A C) 0))).
This simplifies, using linear arithmetic and appealing to the lemma
REMAINDER-NOOP, to the following three new goals:
Case 3.3.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP A C)
(EQUAL (REMAINDER B C) 0)
(NUMBERP A)
(NOT (EQUAL A 0))
(LESSP A B))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(IF (LESSP B A) (REMAINDER A C) 0))).
This again simplifies, using linear arithmetic, appealing to the lemmas
DIFFERENCE-LEQ-ARG1 and REMAINDER-NOOP, and unfolding the function NUMBERP,
to the conjecture:
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP A C)
(EQUAL (REMAINDER B C) 0)
(NUMBERP A)
(NOT (EQUAL A 0))
(LESSP A B))
(NOT (LESSP B A))).
However this again simplifies, using linear arithmetic, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP A C)
(EQUAL (REMAINDER B C) 0)
(NUMBERP A)
(NOT (EQUAL A 0))
(NOT (LESSP A B))
(NOT (LESSP B A)))
(EQUAL (DIFFERENCE A B) 0)),
which again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP A C)
(EQUAL (REMAINDER B C) 0)
(NUMBERP A)
(NOT (EQUAL A 0))
(NOT (LESSP A B))
(LESSP B A))
(EQUAL (DIFFERENCE A B) A)),
which again simplifies, using linear arithmetic, rewriting with
REMAINDER-NOOP, and opening up EQUAL, LESSP, and DIFFERENCE, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(LESSP B C)
(EQUAL (REMAINDER B C) 0)
(NOT (EQUAL (REMAINDER A C) 0)))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(IF (LESSP B A) (REMAINDER A C) 0))).
This simplifies, applying REMAINDER-NOOP, and opening up EQUAL, DIFFERENCE,
and LESSP, to four new formulas:
Case 2.4.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(LESSP B C)
(EQUAL B 0)
(NOT (EQUAL (REMAINDER A C) 0))
(NOT (NUMBERP A)))
(EQUAL (REMAINDER 0 C) 0)),
which again simplifies, expanding LESSP, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(LESSP B C)
(EQUAL B 0)
(NOT (EQUAL (REMAINDER A C) 0))
(EQUAL A 0))
(EQUAL (REMAINDER 0 C) 0)),
which again simplifies, trivially, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(LESSP B C)
(NOT (NUMBERP B))
(NOT (EQUAL (REMAINDER A C) 0))
(NOT (NUMBERP A)))
(EQUAL (REMAINDER 0 C) 0)).
However this again simplifies, expanding LESSP, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(LESSP B C)
(NOT (NUMBERP B))
(NOT (EQUAL (REMAINDER A C) 0))
(EQUAL A 0))
(EQUAL (REMAINDER 0 C) 0)),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES
(AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(IMPLIES (AND (EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0)))
(EQUAL (REMAINDER (DIFFERENCE A
(PLUS C (DIFFERENCE B C)))
C)
(IF (LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(REMAINDER (DIFFERENCE A C) C)
0)))
(EQUAL (REMAINDER B C) 0)
(NOT (EQUAL (REMAINDER A C) 0)))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(IF (LESSP B A) (REMAINDER A C) 0))),
which simplifies, using linear arithmetic, rewriting with
COMMUTATIVITY-OF-PLUS, CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, PLUS-ZERO-ARG2,
PLUS-DIFFERENCE-ARG2, REMAINDER-NOOP, REMAINDER-OF-NON-NUMBER, and
DIFFERENCE-LEQ-ARG1, and expanding the definitions of NOT, AND, FIX, ZEROP,
IMPLIES, NUMBERP, EQUAL, DIFFERENCE, LESSP, and REMAINDER, to the following
nine new goals:
Case 1.9.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(NOT (NUMBERP B))
(EQUAL (REMAINDER (DIFFERENCE A 0) C)
(REMAINDER (DIFFERENCE A C) C))
(NOT (EQUAL (REMAINDER A C) 0))
(NOT (NUMBERP A)))
(EQUAL (REMAINDER 0 C) 0)).
However this again simplifies, opening up the definition of LESSP, to:
T.
Case 1.8.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(NOT (NUMBERP B))
(EQUAL (REMAINDER (DIFFERENCE A 0) C)
(REMAINDER (DIFFERENCE A C) C))
(NOT (EQUAL (REMAINDER A C) 0))
(EQUAL A 0))
(EQUAL (REMAINDER 0 C) 0)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(NUMBERP B)
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(REMAINDER (DIFFERENCE A C) C))
(EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A B) C)
0)))
(LESSP B A)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(NOT (LESSP (DIFFERENCE B C)
(DIFFERENCE A C)))
(LESSP C B)
(NOT (NUMBERP B))
(EQUAL (REMAINDER (DIFFERENCE A 0) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(NOT (NUMBERP A)))
(EQUAL (REMAINDER 0 C) 0)),
which again simplifies, opening up the definition of LESSP, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(NOT (LESSP (DIFFERENCE B C)
(DIFFERENCE A C)))
(LESSP C B)
(NOT (NUMBERP B))
(EQUAL (REMAINDER (DIFFERENCE A 0) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(EQUAL A 0))
(EQUAL (REMAINDER 0 C) 0)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(NOT (LESSP (DIFFERENCE B C)
(DIFFERENCE A C)))
(LESSP C B)
(NOT (NUMBERP B))
(EQUAL (REMAINDER (DIFFERENCE A 0) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(NOT (EQUAL A 0))
(NUMBERP A))
(EQUAL (REMAINDER A C)
(REMAINDER (DIFFERENCE A C) C))),
which again simplifies, expanding the function LESSP, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(NOT (LESSP (DIFFERENCE B C)
(DIFFERENCE A C)))
(LESSP C B)
(NUMBERP B)
(EQUAL (REMAINDER (DIFFERENCE A B) C)
0)
(EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0)))
(NOT (LESSP B A))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(NOT (LESSP C B))
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(NOT (LESSP B A)))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
0)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(NOT (LESSP C B))
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(LESSP B A))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(REMAINDER (DIFFERENCE A C) C))),
which again simplifies, using linear arithmetic, to two new conjectures:
Case 1.1.2.
(IMPLIES (AND (NOT (NUMBERP B))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(NOT (LESSP C B))
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(LESSP B A))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
(REMAINDER (DIFFERENCE A C) C))),
which again simplifies, expanding the definition of LESSP, to:
T.
Case 1.1.1.
(IMPLIES (AND (NUMBERP B)
(NOT (EQUAL B 0))
(NOT (LESSP A B))
(NOT (LESSP B B))
(LESSP (DIFFERENCE B B)
(DIFFERENCE A B))
(NOT (LESSP B B))
(NOT (EQUAL (REMAINDER (DIFFERENCE A B) B)
0))
(LESSP B A))
(EQUAL (REMAINDER (DIFFERENCE A B) B)
(REMAINDER (DIFFERENCE A B) B))),
which again simplifies, obviously, to:
T.
Q.E.D.
[ 0.0 0.6 0.0 ]
REMAINDER-DIFFERENCE3
(DISABLE REMAINDER-DIFFERENCE3)
[ 0.0 0.0 0.0 ]
REMAINDER-DIFFERENCE3-OFF
(LEMMA EQUAL-REMAINDER-DIFFERENCE-0
(REWRITE)
(EQUAL (EQUAL (REMAINDER (DIFFERENCE A B) C)
0)
(IF (LEQ B A)
(EQUAL (REMAINDER A C)
(REMAINDER B C))
T))
((ENABLE LESSP-REMAINDER REMAINDER-DIFFERENCE1 REMAINDER-OF-NON-NUMBER
REMAINDER-PLUS REMAINDER-QUOTIENT-ELIM
REMAINDER-TIMES1-INSTANCE REMAINDER-ZERO)
(ENABLE-THEORY ADDITION)
(DO-NOT-INDUCT T)))
This simplifies, clearly, to the following three new goals:
Case 3. (IMPLIES (NOT (EQUAL (REMAINDER (DIFFERENCE A B) C)
0))
(NOT (LESSP A B))).
This again simplifies, using linear arithmetic, applying DIFFERENCE-LEQ-ARG1,
and unfolding LESSP, EQUAL, NUMBERP, and REMAINDER, to:
T.
Case 2. (IMPLIES (NOT (EQUAL (REMAINDER (DIFFERENCE A B) C)
0))
(NOT (EQUAL (REMAINDER A C)
(REMAINDER B C)))).
But this again simplifies, rewriting with the lemmas DIFFERENCE-X-X and
REMAINDER-DIFFERENCE1, and opening up the definition of EQUAL, to:
T.
Case 1. (IMPLIES (AND (EQUAL (REMAINDER (DIFFERENCE A B) C)
0)
(NOT (LESSP A B)))
(EQUAL (EQUAL (REMAINDER A C)
(REMAINDER B C))
T)),
which again simplifies, trivially, to:
(IMPLIES (AND (EQUAL (REMAINDER (DIFFERENCE A B) C)
0)
(NOT (LESSP A B)))
(EQUAL (REMAINDER A C)
(REMAINDER B C))).
Applying the lemmas DIFFERENCE-ELIM and REMAINDER-QUOTIENT-ELIM, replace A
by (PLUS B X) to eliminate (DIFFERENCE A B) and X by (PLUS Z (TIMES C V)) to
eliminate (REMAINDER X C) and (QUOTIENT X C). We use the type restriction
lemma noted when DIFFERENCE was introduced, LESSP-REMAINDER, the type
restriction lemma noted when REMAINDER was introduced, and the type
restriction lemma noted when QUOTIENT was introduced to restrict the new
variables. We would thus like to prove the following four new conjectures:
Case 1.4.
(IMPLIES (AND (NOT (NUMBERP A))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
0)
(NOT (LESSP A B)))
(EQUAL (REMAINDER A C)
(REMAINDER B C))).
But this further simplifies, using linear arithmetic, appealing to the
lemmas DIFFERENCE-LEQ-ARG1 and REMAINDER-OF-NON-NUMBER, and expanding the
functions LESSP, EQUAL, NUMBERP, and REMAINDER, to:
T.
Case 1.3.
(IMPLIES (AND (EQUAL C 0)
(NUMBERP X)
(EQUAL (REMAINDER X C) 0)
(NOT (LESSP (PLUS B X) B)))
(EQUAL (REMAINDER (PLUS B X) C)
(REMAINDER B C))),
which further simplifies, applying REMAINDER-ZERO and PLUS-ZERO-ARG2, and
expanding the functions ZEROP, REMAINDER, and EQUAL, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (NUMBERP C))
(NUMBERP X)
(EQUAL (REMAINDER X C) 0)
(NOT (LESSP (PLUS B X) B)))
(EQUAL (REMAINDER (PLUS B X) C)
(REMAINDER B C))).
However this further simplifies, rewriting with REMAINDER-ZERO and
PLUS-ZERO-ARG2, and opening up the definitions of ZEROP, NUMBERP, and
EQUAL, to:
T.
Case 1.1.
(IMPLIES (AND (NUMBERP Z)
(EQUAL (LESSP Z C) (NOT (ZEROP C)))
(NUMBERP V)
(NUMBERP C)
(NOT (EQUAL C 0))
(EQUAL Z 0)
(NOT (LESSP (PLUS B Z (TIMES C V)) B)))
(EQUAL (REMAINDER (PLUS B Z (TIMES C V)) C)
(REMAINDER B C))).
But this further simplifies, applying CORRECTNESS-OF-CANCEL-LESSP-PLUS,
REMAINDER-TIMES1-INSTANCE, and REMAINDER-PLUS, and unfolding the functions
NUMBERP, EQUAL, LESSP, ZEROP, NOT, and PLUS, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
EQUAL-REMAINDER-DIFFERENCE-0
(DISABLE EQUAL-REMAINDER-DIFFERENCE-0)
[ 0.0 0.0 0.0 ]
EQUAL-REMAINDER-DIFFERENCE-0-OFF
(LEMMA LESSP-PLUS-FACT
(REWRITE)
(IMPLIES (AND (EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP B C)
(LESSP A X))
(EQUAL (LESSP (PLUS A B) C) T))
((ENABLE-THEORY ADDITION)
(INDUCT (DOUBLE-REMAINDER-INDUCTION B C X))))
WARNING: Note that LESSP-PLUS-FACT contains the free variable X which will be
chosen by instantiating the hypothesis (EQUAL (REMAINDER B X) 0).
This formula can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to the following four new conjectures:
Case 4. (IMPLIES (AND (ZEROP X)
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP B C)
(LESSP A X))
(EQUAL (LESSP (PLUS A B) C) T)).
This simplifies, unfolding ZEROP, EQUAL, REMAINDER, and LESSP, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(LESSP B X)
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP B C)
(LESSP A X))
(EQUAL (LESSP (PLUS A B) C) T)).
This simplifies, appealing to the lemma PLUS-ZERO-ARG2, and expanding
REMAINDER, EQUAL, LESSP, and ZEROP, to the following four new goals:
Case 3.4.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(LESSP B X)
(EQUAL B 0)
(EQUAL (REMAINDER C X) 0)
(NOT (EQUAL C 0))
(NUMBERP C)
(LESSP A X)
(NOT (NUMBERP A)))
(LESSP 0 C)).
This again simplifies, using linear arithmetic, to:
T.
Case 3.3.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(LESSP B X)
(EQUAL B 0)
(EQUAL (REMAINDER C X) 0)
(NOT (EQUAL C 0))
(NUMBERP C)
(LESSP A X)
(NUMBERP A))
(LESSP A C)),
which again simplifies, using linear arithmetic, appealing to the lemma
DIFFERENCE-LEQ-ARG1, and unfolding the definitions of EQUAL, LESSP,
REMAINDER, and NUMBERP, to the formula:
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (LESSP C X))
(NOT (EQUAL C 0))
(NUMBERP C)
(LESSP A X)
(NUMBERP A))
(LESSP A C)).
But this again simplifies, using linear arithmetic, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(LESSP B X)
(NOT (NUMBERP B))
(EQUAL (REMAINDER C X) 0)
(NOT (EQUAL C 0))
(NUMBERP C)
(LESSP A X)
(NOT (NUMBERP A)))
(LESSP 0 C)),
which again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(LESSP B X)
(NOT (NUMBERP B))
(EQUAL (REMAINDER C X) 0)
(NOT (EQUAL C 0))
(NUMBERP C)
(LESSP A X)
(NUMBERP A))
(LESSP A C)),
which again simplifies, using linear arithmetic, appealing to the lemma
DIFFERENCE-LEQ-ARG1, and opening up the definitions of LESSP, REMAINDER,
NUMBERP, and EQUAL, to:
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (NUMBERP B))
(NOT (LESSP C X))
(NOT (EQUAL C 0))
(NUMBERP C)
(LESSP A X)
(NUMBERP A))
(LESSP A C)).
But this again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (LESSP B X))
(LESSP C X)
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP B C)
(LESSP A X))
(EQUAL (LESSP (PLUS A B) C) T)),
which simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (LESSP B X))
(NOT (LESSP C X))
(IMPLIES (AND (EQUAL (REMAINDER (DIFFERENCE B X) X)
0)
(EQUAL (REMAINDER (DIFFERENCE C X) X)
0)
(LESSP (DIFFERENCE B X)
(DIFFERENCE C X))
(LESSP A X))
(EQUAL (LESSP (PLUS A (DIFFERENCE B X))
(DIFFERENCE C X))
T))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP B C)
(LESSP A X))
(EQUAL (LESSP (PLUS A B) C) T)),
which simplifies, rewriting with PLUS-ZERO-ARG2, PLUS-DIFFERENCE-ARG2, and
DIFFERENCE-LEQ-ARG1, and opening up the functions AND, ZEROP, IMPLIES,
REMAINDER, NUMBERP, LESSP, EQUAL, and PLUS, to the following four new goals:
Case 1.4.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (LESSP B X))
(NOT (LESSP C X))
(NOT (LESSP (DIFFERENCE B X)
(DIFFERENCE C X)))
(EQUAL (REMAINDER (DIFFERENCE B X) X)
0)
(EQUAL (REMAINDER (DIFFERENCE C X) X)
0)
(LESSP B C)
(LESSP A X))
(LESSP (PLUS A B) C)).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (LESSP B X))
(NOT (LESSP C X))
(NOT (LESSP X B))
(NUMBERP A)
(LESSP A (DIFFERENCE C X))
(EQUAL (REMAINDER (DIFFERENCE C X) X)
0)
(LESSP B C)
(LESSP A X))
(LESSP (PLUS A B) C)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (LESSP B X))
(NOT (LESSP C X))
(NOT (LESSP X B))
(NOT (NUMBERP A))
(LESSP 0 (DIFFERENCE C X))
(EQUAL (REMAINDER (DIFFERENCE C X) X)
0)
(LESSP B C)
(NOT (NUMBERP B)))
(LESSP 0 C)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (LESSP B X))
(NOT (LESSP C X))
(LESSP X B)
(LESSP (DIFFERENCE (PLUS A B) X)
(DIFFERENCE C X))
(EQUAL (REMAINDER (DIFFERENCE B X) X)
0)
(EQUAL (REMAINDER (DIFFERENCE C X) X)
0)
(LESSP B C)
(LESSP A X))
(LESSP (PLUS A B) C)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.4 0.0 ]
LESSP-PLUS-FACT
(DISABLE LESSP-PLUS-FACT)
[ 0.0 0.0 0.0 ]
LESSP-PLUS-FACT-OFF
(LEMMA REMAINDER-PLUS-FACT NIL
(IMPLIES (AND (EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP A X))
(EQUAL (REMAINDER (PLUS A B) C)
(PLUS A (REMAINDER B C))))
((ENABLE LESSP-PLUS-FACT REMAINDER-NOOP REMAINDER-DIFFERENCE1)
(ENABLE-THEORY ADDITION MULTIPLICATION)
(INDUCT (REMAINDER B C))))
This formula can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to the following three new conjectures:
Case 3. (IMPLIES (AND (ZEROP C)
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP A X))
(EQUAL (REMAINDER (PLUS A B) C)
(PLUS A (REMAINDER B C)))).
This simplifies, using linear arithmetic, appealing to the lemmas
REMAINDER-NOOP and CORRECTNESS-OF-CANCEL-EQUAL-PLUS, and opening up the
definitions of ZEROP, NUMBERP, EQUAL, REMAINDER, and FIX, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP A X))
(EQUAL (REMAINDER (PLUS A B) C)
(PLUS A (REMAINDER B C)))).
This simplifies, applying LESSP-PLUS-FACT, REMAINDER-NOOP, and
CORRECTNESS-OF-CANCEL-EQUAL-PLUS, and unfolding the function FIX, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(IMPLIES (AND (EQUAL (REMAINDER (DIFFERENCE B C) X)
0)
(EQUAL (REMAINDER C X) 0)
(LESSP A X))
(EQUAL (REMAINDER (PLUS A (DIFFERENCE B C))
C)
(PLUS A
(REMAINDER (DIFFERENCE B C) C))))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP A X))
(EQUAL (REMAINDER (PLUS A B) C)
(PLUS A (REMAINDER B C)))),
which simplifies, using linear arithmetic, applying REMAINDER-DIFFERENCE1,
PLUS-ZERO-ARG2, PLUS-DIFFERENCE-ARG2, REMAINDER-NOOP, and
DIFFERENCE-LEQ-ARG1, and unfolding EQUAL, DIFFERENCE, AND, ZEROP, IMPLIES,
NUMBERP, REMAINDER, LESSP, and PLUS, to the following four new formulas:
Case 1.4.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(NUMBERP A)
(EQUAL (REMAINDER A C)
(PLUS A
(REMAINDER (DIFFERENCE B C) C)))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP A X))
(EQUAL (REMAINDER (PLUS A B) C) A)).
However this again simplifies, using linear arithmetic, to two new
conjectures:
Case 1.4.2.
(IMPLIES (AND (NOT (NUMBERP B))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(NUMBERP A)
(EQUAL (REMAINDER A C)
(PLUS A
(REMAINDER (DIFFERENCE B C) C)))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP A X))
(EQUAL (REMAINDER (PLUS A B) C) A)),
which again simplifies, opening up the function LESSP, to:
T.
Case 1.4.1.
(IMPLIES (AND (NUMBERP B)
(NOT (EQUAL B 0))
(NOT (LESSP B B))
(NOT (LESSP B B))
(NUMBERP A)
(EQUAL (REMAINDER A B)
(PLUS A
(REMAINDER (DIFFERENCE B B) B)))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER B X) 0)
(LESSP A X))
(EQUAL (REMAINDER (PLUS A B) B) A)),
which again simplifies, using linear arithmetic, rewriting with
DIFFERENCE-X-X, REMAINDER-NOOP, PLUS-ZERO-ARG2,
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and
CORRECTNESS-OF-CANCEL-LESSP-PLUS, and unfolding the functions NUMBERP,
ZEROP, EQUAL, FIX, and REMAINDER, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(NOT (NUMBERP A))
(EQUAL (REMAINDER 0 C)
(PLUS A
(REMAINDER (DIFFERENCE B C) C)))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(NOT (EQUAL X 0))
(NUMBERP X)
(NOT (NUMBERP B)))
(EQUAL (REMAINDER 0 C) 0)).
But this again simplifies, unfolding LESSP, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(NOT (NUMBERP A))
(EQUAL (REMAINDER 0 C)
(PLUS A
(REMAINDER (DIFFERENCE B C) C)))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(NOT (EQUAL X 0))
(NUMBERP X)
(NUMBERP B))
(EQUAL (REMAINDER B C) 0)),
which again simplifies, using linear arithmetic, to the formula:
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP B B))
(NOT (LESSP B B))
(NOT (NUMBERP A))
(EQUAL (REMAINDER 0 B)
(PLUS A
(REMAINDER (DIFFERENCE B B) B)))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER B X) 0)
(NOT (EQUAL X 0))
(NUMBERP X)
(NUMBERP B))
(EQUAL (REMAINDER B B) 0)).
But this again simplifies, applying REMAINDER-NOOP, DIFFERENCE-X-X, and
PLUS-ZERO-ARG2, and opening up the definitions of LESSP, EQUAL, NUMBERP,
ZEROP, and REMAINDER, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(LESSP C B)
(EQUAL (REMAINDER (DIFFERENCE (PLUS A B) C)
C)
(PLUS A
(REMAINDER (DIFFERENCE B C) C)))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP A X)
(LESSP (PLUS A B) C))
(EQUAL (PLUS A B)
(PLUS A
(REMAINDER (DIFFERENCE B C) C)))).
However this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.5 0.0 ]
REMAINDER-PLUS-FACT
(LEMMA REMAINDER-PLUS-TIMES-TIMES-PROOF NIL
(IMPLIES (LESSP A B)
(EQUAL (REMAINDER (PLUS A (TIMES B C))
(TIMES B D))
(PLUS A
(REMAINDER (TIMES B C) (TIMES B D)))))
((USE (REMAINDER-PLUS-FACT (A A)
(X B)
(B (TIMES B C))
(C (TIMES B D))))
(ENABLE REMAINDER-TIMES1-INSTANCE REMAINDER-TIMES2-INSTANCE)
(DO-NOT-INDUCT T)))
This conjecture can be simplified, using the abbreviations IMPLIES,
REMAINDER-TIMES2-INSTANCE, and REMAINDER-TIMES1-INSTANCE, to:
(IMPLIES (AND (IMPLIES (AND (EQUAL 0 0)
(EQUAL 0 0)
(LESSP A B))
(EQUAL (REMAINDER (PLUS A (TIMES B C))
(TIMES B D))
(PLUS A (TIMES B (REMAINDER C D)))))
(LESSP A B))
(EQUAL (REMAINDER (PLUS A (TIMES B C))
(TIMES B D))
(PLUS A (TIMES B (REMAINDER C D))))).
This simplifies, opening up the functions EQUAL, AND, and IMPLIES, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-PLUS-TIMES-TIMES-PROOF
(LEMMA REMAINDER-PLUS-TIMES-TIMES
(REWRITE)
(IMPLIES (LESSP A B)
(AND (EQUAL (REMAINDER (PLUS A (TIMES B C))
(TIMES B D))
(PLUS A
(REMAINDER (TIMES B C) (TIMES B D))))
(EQUAL (REMAINDER (PLUS A (TIMES C B))
(TIMES D B))
(PLUS A
(REMAINDER (TIMES C B)
(TIMES D B))))))
((USE (REMAINDER-PLUS-TIMES-TIMES-PROOF (A A)
(B B)
(C C)
(D D)))
(ENABLE COMMUTATIVITY-OF-TIMES)
(DO-NOT-INDUCT T)))
WARNING: Note that the proposed lemma REMAINDER-PLUS-TIMES-TIMES is to be
stored as zero type prescription rules, zero compound recognizer rules, zero
linear rules, and two replacement rules.
This simplifies, applying the lemma COMMUTATIVITY-OF-TIMES, and opening up the
functions IMPLIES and AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-PLUS-TIMES-TIMES
(LEMMA REMAINDER-PLUS-TIMES-TIMES-INSTANCE
(REWRITE)
(IMPLIES (LESSP A B)
(AND (EQUAL (REMAINDER (PLUS A (TIMES B C) (TIMES B D))
(TIMES B E))
(PLUS A
(TIMES B (REMAINDER (PLUS C D) E))))
(EQUAL (REMAINDER (PLUS A (TIMES C B) (TIMES D B))
(TIMES E B))
(PLUS A
(TIMES B (REMAINDER (PLUS C D) E))))))
((ENABLE COMMUTATIVITY-OF-TIMES REMAINDER-TIMES-TIMES
REMAINDER-PLUS-TIMES-TIMES)
(USE (TIMES-DISTRIBUTES-OVER-PLUS (X B)
(Y C)
(Z D)))
(DO-NOT-INDUCT T)))
WARNING: Note that the proposed lemma REMAINDER-PLUS-TIMES-TIMES-INSTANCE is
to be stored as zero type prescription rules, zero compound recognizer rules,
zero linear rules, and two replacement rules.
This formula simplifies, rewriting with the lemmas COMMUTATIVITY-OF-TIMES,
REMAINDER-TIMES-TIMES, and REMAINDER-PLUS-TIMES-TIMES, and expanding AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-PLUS-TIMES-TIMES-INSTANCE
(LEMMA REMAINDER-REMAINDER
(REWRITE)
(IMPLIES (EQUAL (REMAINDER B A) 0)
(EQUAL (REMAINDER (REMAINDER N B) A)
(REMAINDER N A)))
((INDUCT (REMAINDER N B))
(ENABLE REMAINDER-PLUS REMAINDER-QUOTIENT-ELIM REMAINDER-ZERO)
(ENABLE-THEORY ADDITION MULTIPLICATION)))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to three new formulas:
Case 3. (IMPLIES (AND (ZEROP B)
(EQUAL (REMAINDER B A) 0))
(EQUAL (REMAINDER (REMAINDER N B) A)
(REMAINDER N A))),
which simplifies, applying REMAINDER-ZERO, and opening up the definitions of
ZEROP, LESSP, EQUAL, NUMBERP, and REMAINDER, to the following two new goals:
Case 3.2.
(IMPLIES (AND (EQUAL B 0) (NOT (NUMBERP N)))
(EQUAL (REMAINDER 0 A)
(REMAINDER N A))).
However this again simplifies, unfolding LESSP, EQUAL, NUMBERP, and
REMAINDER, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (NUMBERP B))
(NOT (NUMBERP N)))
(EQUAL (REMAINDER 0 A)
(REMAINDER N A))),
which again simplifies, unfolding the definitions of LESSP, EQUAL, NUMBERP,
and REMAINDER, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(LESSP N B)
(EQUAL (REMAINDER B A) 0))
(EQUAL (REMAINDER (REMAINDER N B) A)
(REMAINDER N A))),
which simplifies, expanding REMAINDER, to:
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(LESSP N B)
(EQUAL (REMAINDER B A) 0)
(NOT (NUMBERP N)))
(EQUAL (REMAINDER 0 A)
(REMAINDER N A))).
But this again simplifies, unfolding the functions LESSP, EQUAL, NUMBERP,
and REMAINDER, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP N B))
(IMPLIES (EQUAL (REMAINDER B A) 0)
(EQUAL (REMAINDER (REMAINDER (DIFFERENCE N B) B)
A)
(REMAINDER (DIFFERENCE N B) A)))
(EQUAL (REMAINDER B A) 0))
(EQUAL (REMAINDER (REMAINDER N B) A)
(REMAINDER N A))),
which simplifies, expanding EQUAL, IMPLIES, and REMAINDER, to the goal:
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP N B))
(EQUAL (REMAINDER (REMAINDER (DIFFERENCE N B) B)
A)
(REMAINDER (DIFFERENCE N B) A))
(EQUAL (REMAINDER B A) 0))
(EQUAL (REMAINDER (DIFFERENCE N B) A)
(REMAINDER N A))).
Appealing to the lemmas DIFFERENCE-ELIM and REMAINDER-QUOTIENT-ELIM, we now
replace N by (PLUS B X) to eliminate (DIFFERENCE N B), X by
(PLUS Z (TIMES B V)) to eliminate (REMAINDER X B) and (QUOTIENT X B), and Z
by (PLUS X (TIMES A W)) to eliminate (REMAINDER Z A) and (QUOTIENT Z A). We
employ the type restriction lemma noted when DIFFERENCE was introduced, the
type restriction lemma noted when REMAINDER was introduced, and the type
restriction lemma noted when QUOTIENT was introduced to constrain the new
variables. We must thus prove four new formulas:
Case 1.4.
(IMPLIES (AND (NOT (NUMBERP N))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP N B))
(EQUAL (REMAINDER (REMAINDER (DIFFERENCE N B) B)
A)
(REMAINDER (DIFFERENCE N B) A))
(EQUAL (REMAINDER B A) 0))
(EQUAL (REMAINDER (DIFFERENCE N B) A)
(REMAINDER N A))),
which further simplifies, unfolding LESSP, to:
T.
Case 1.3.
(IMPLIES (AND (EQUAL A 0)
(NUMBERP Z)
(NUMBERP V)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (PLUS B Z (TIMES B V)) B))
(EQUAL (REMAINDER Z A)
(REMAINDER (PLUS Z (TIMES B V)) A))
(EQUAL (REMAINDER B A) 0))
(EQUAL (REMAINDER (PLUS Z (TIMES B V)) A)
(REMAINDER (PLUS B Z (TIMES B V))
A))),
which further simplifies, applying CORRECTNESS-OF-CANCEL-LESSP-PLUS,
REMAINDER-ZERO, CORRECTNESS-OF-CANCEL-EQUAL-PLUS, and EQUAL-TIMES-0, and
opening up the definitions of ZEROP and FIX, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (NUMBERP A))
(NUMBERP Z)
(NUMBERP V)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (PLUS B Z (TIMES B V)) B))
(EQUAL (REMAINDER Z A)
(REMAINDER (PLUS Z (TIMES B V)) A))
(EQUAL (REMAINDER B A) 0))
(EQUAL (REMAINDER (PLUS Z (TIMES B V)) A)
(REMAINDER (PLUS B Z (TIMES B V))
A))).
However this further simplifies, applying the lemmas
CORRECTNESS-OF-CANCEL-LESSP-PLUS, REMAINDER-ZERO,
CORRECTNESS-OF-CANCEL-EQUAL-PLUS, and EQUAL-TIMES-0, and unfolding ZEROP
and FIX, to:
T.
Case 1.1.
(IMPLIES (AND (NUMBERP X)
(NUMBERP W)
(NUMBERP A)
(NOT (EQUAL A 0))
(NUMBERP V)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (PLUS B
(PLUS X (TIMES A W))
(TIMES B V))
B))
(EQUAL X
(REMAINDER (PLUS (PLUS X (TIMES A W))
(TIMES B V))
A))
(EQUAL (REMAINDER B A) 0))
(EQUAL (REMAINDER (PLUS (PLUS X (TIMES A W))
(TIMES B V))
A)
(REMAINDER (PLUS B
(PLUS X (TIMES A W))
(TIMES B V))
A))),
which further simplifies, applying ASSOCIATIVITY-OF-PLUS,
CORRECTNESS-OF-CANCEL-LESSP-PLUS, and REMAINDER-PLUS, to:
T.
Q.E.D.
[ 0.0 0.7 0.0 ]
REMAINDER-REMAINDER
(LEMMA REMAINDER-1-ARG1
(REWRITE)
(EQUAL (REMAINDER 1 X)
(IF (EQUAL X 1) 0 1))
((ENABLE DIFFERENCE-LEQ-ARG1)))
This simplifies, rewriting with DIFFERENCE-LEQ-ARG1, and opening up DIFFERENCE,
EQUAL, SUB1, LESSP, NUMBERP, and REMAINDER, to four new conjectures:
Case 4. (IMPLIES (AND (NOT (EQUAL X 1))
(NOT (EQUAL X 0))
(NUMBERP X))
(LESSP 1 X)),
which again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (EQUAL X 1)
(NOT (LESSP 1 X))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (EQUAL X 1) (NUMBERP X)),
which again simplifies, trivially, to:
T.
Case 1. (IMPLIES (EQUAL X 1)
(NOT (EQUAL X 0))).
But this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-1-ARG1
(LEMMA REMAINDER-1-ARG2
(REWRITE)
(EQUAL (REMAINDER Y 1) 0))
Call the conjecture *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP 1) (p Y))
(IMPLIES (AND (NOT (ZEROP 1)) (LESSP Y 1))
(p Y))
(IMPLIES (AND (NOT (ZEROP 1))
(NOT (LESSP Y 1))
(p (DIFFERENCE Y 1)))
(p Y))).
Linear arithmetic, the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP, and the
definition of ZEROP can be used to establish that the measure (COUNT Y)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme generates the following three new
formulas:
Case 3. (IMPLIES (ZEROP 1)
(EQUAL (REMAINDER Y 1) 0)).
This simplifies, expanding the definition of ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP 1)) (LESSP Y 1))
(EQUAL (REMAINDER Y 1) 0)).
This simplifies, opening up the functions ZEROP, REMAINDER, EQUAL, and
NUMBERP, to the new goal:
(IMPLIES (AND (LESSP Y 1) (NUMBERP Y))
(EQUAL Y 0)),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP 1))
(NOT (LESSP Y 1))
(EQUAL (REMAINDER (DIFFERENCE Y 1) 1)
0))
(EQUAL (REMAINDER Y 1) 0)),
which simplifies, expanding ZEROP, REMAINDER, EQUAL, and NUMBERP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-1-ARG2
(LEMMA REMAINDER-X-X
(REWRITE)
(EQUAL (REMAINDER X X) 0)
((ENABLE EQUAL-DIFFERENCE-0)))
Name the conjecture *1.
Let us appeal to the induction principle. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP X) (p X))
(IMPLIES (AND (NOT (ZEROP X)) (LESSP X X))
(p X))
(IMPLIES (AND (NOT (ZEROP X))
(NOT (LESSP X X))
(p (DIFFERENCE X X)))
(p X))).
Linear arithmetic, the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP, and the
definition of ZEROP inform us that the measure (COUNT X) decreases according
to the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme leads to three new conjectures:
Case 3. (IMPLIES (ZEROP X)
(EQUAL (REMAINDER X X) 0)),
which simplifies, expanding ZEROP, REMAINDER, and EQUAL, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP X)) (LESSP X X))
(EQUAL (REMAINDER X X) 0)),
which simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(NOT (LESSP X X))
(EQUAL (REMAINDER (DIFFERENCE X X)
(DIFFERENCE X X))
0))
(EQUAL (REMAINDER X X) 0)),
which simplifies, applying the lemma EQUAL-DIFFERENCE-0, and unfolding ZEROP,
REMAINDER, and LESSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-X-X
(LEMMA TRANSITIVITY-OF-DIVIDES NIL
(IMPLIES (AND (EQUAL (REMAINDER A B) 0)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER A C) 0))
((ENABLE REMAINDER REMAINDER-NOOP REMAINDER-PLUS)
(ENABLE-THEORY ADDITION)))
Name the conjecture *1.
We will try to prove it by induction. The recursive terms in the
conjecture suggest three inductions, two of which are unflawed. Since both of
these are equally likely, we will choose arbitrarily. We will induct
according to the following scheme:
(AND (IMPLIES (ZEROP B) (p A C B))
(IMPLIES (AND (NOT (ZEROP B)) (LESSP A B))
(p A C B))
(IMPLIES (AND (NOT (ZEROP B))
(NOT (LESSP A B))
(p (DIFFERENCE A B) C B))
(p A C B))).
Linear arithmetic, the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP, and the
definition of ZEROP can be used to prove that the measure (COUNT A) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme generates the following four new
conjectures:
Case 4. (IMPLIES (AND (ZEROP B)
(EQUAL (REMAINDER A B) 0)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER A C) 0)).
This simplifies, expanding the functions ZEROP, EQUAL, REMAINDER, LESSP, and
NUMBERP, to:
T.
Case 3. (IMPLIES (AND (NOT (ZEROP B))
(LESSP A B)
(EQUAL (REMAINDER A B) 0)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER A C) 0)).
This simplifies, appealing to the lemma REMAINDER-NOOP, and opening up ZEROP,
LESSP, EQUAL, NUMBERP, and REMAINDER, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP B))
(NOT (LESSP A B))
(NOT (EQUAL (REMAINDER (DIFFERENCE A B) B)
0))
(EQUAL (REMAINDER A B) 0)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER A C) 0)).
This simplifies, expanding ZEROP and REMAINDER, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP B))
(NOT (LESSP A B))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
0)
(EQUAL (REMAINDER A B) 0)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER A C) 0)).
This simplifies, opening up ZEROP and REMAINDER, to:
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
0)
(EQUAL (REMAINDER (DIFFERENCE A B) B)
0)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER A C) 0)).
Applying the lemma DIFFERENCE-ELIM, replace A by (PLUS B X) to eliminate
(DIFFERENCE A B). We use the type restriction lemma noted when DIFFERENCE
was introduced to restrict the new variable. We would thus like to prove
the following two new goals:
Case 1.2.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(EQUAL (REMAINDER (DIFFERENCE A B) C)
0)
(EQUAL (REMAINDER (DIFFERENCE A B) B)
0)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER A C) 0)).
But this further simplifies, expanding the function LESSP, to:
T.
Case 1.1.
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (PLUS B X) B))
(EQUAL (REMAINDER X C) 0)
(EQUAL (REMAINDER X B) 0)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER (PLUS B X) C) 0)),
which further simplifies, applying the lemmas
CORRECTNESS-OF-CANCEL-LESSP-PLUS and REMAINDER-PLUS, and expanding EQUAL,
to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.3 0.0 ]
TRANSITIVITY-OF-DIVIDES
(DEFTHEORY REMAINDERS
(LESSP-REMAINDER REMAINDER-NOOP REMAINDER-OF-NON-NUMBER
REMAINDER-ZERO REMAINDER-QUOTIENT-ELIM
REMAINDER-ADD1 REMAINDER-PLUS
EQUAL-REMAINDER-PLUS-0 REMAINDER-TIMES1
REMAINDER-TIMES1-INSTANCE REMAINDER-TIMES2
REMAINDER-TIMES2-INSTANCE REMAINDER-DIFFERENCE1
REMAINDER-DIFFERENCE2 REMAINDER-PLUS-TIMES-TIMES
REMAINDER-PLUS-TIMES-TIMES-INSTANCE
REMAINDER-REMAINDER REMAINDER-1-ARG1
REMAINDER-1-ARG2 REMAINDER-X-X))
[ 0.0 0.0 0.0 ]
REMAINDERS
(LEMMA QUOTIENT-NOOP
(REWRITE)
(IMPLIES (EQUAL B 1)
(EQUAL (QUOTIENT A B) (FIX A))))
This conjecture simplifies, unfolding FIX, to two new conjectures:
Case 2. (IMPLIES (NOT (NUMBERP A))
(EQUAL (QUOTIENT A 1) 0)),
which again simplifies, opening up LESSP, NUMBERP, EQUAL, and QUOTIENT, to:
T.
Case 1. (IMPLIES (NUMBERP A)
(EQUAL (QUOTIENT A 1) A)),
which we will name *1.
Perhaps we can prove it by induction. There is only one plausible
induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP 1) (p A))
(IMPLIES (AND (NOT (ZEROP 1)) (LESSP A 1))
(p A))
(IMPLIES (AND (NOT (ZEROP 1))
(NOT (LESSP A 1))
(p (DIFFERENCE A 1)))
(p A))).
Linear arithmetic, the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP, and the
definition of ZEROP inform us that the measure (COUNT A) decreases according
to the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme leads to the following three new formulas:
Case 3. (IMPLIES (AND (ZEROP 1) (NUMBERP A))
(EQUAL (QUOTIENT A 1) A)).
This simplifies, unfolding the definition of ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP 1))
(LESSP A 1)
(NUMBERP A))
(EQUAL (QUOTIENT A 1) A)).
This simplifies, expanding the definitions of ZEROP, QUOTIENT, EQUAL, and
NUMBERP, to the new conjecture:
(IMPLIES (AND (LESSP A 1) (NUMBERP A))
(EQUAL 0 A)),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP 1))
(NOT (LESSP A 1))
(EQUAL (QUOTIENT (DIFFERENCE A 1) 1)
(DIFFERENCE A 1))
(NUMBERP A))
(EQUAL (QUOTIENT A 1) A)),
which simplifies, opening up the functions ZEROP, QUOTIENT, EQUAL, and
NUMBERP, to:
(IMPLIES (AND (NOT (LESSP A 1))
(EQUAL (QUOTIENT (DIFFERENCE A 1) 1)
(DIFFERENCE A 1))
(NUMBERP A))
(EQUAL (ADD1 (DIFFERENCE A 1)) A)).
This again simplifies, using linear arithmetic, to:
(IMPLIES (AND (EQUAL A 0)
(NOT (LESSP A 1))
(EQUAL (QUOTIENT (DIFFERENCE A 1) 1)
(DIFFERENCE A 1))
(NUMBERP A))
(EQUAL (ADD1 (DIFFERENCE A 1)) A)).
But this again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-NOOP
(LEMMA QUOTIENT-OF-NON-NUMBER
(REWRITE)
(IMPLIES (NOT (NUMBERP A))
(EQUAL (QUOTIENT A N)
(QUOTIENT 0 N))))
This simplifies, opening up the functions LESSP, QUOTIENT, and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-OF-NON-NUMBER
(LEMMA QUOTIENT-ZERO
(REWRITE)
(IMPLIES (ZEROP X)
(EQUAL (QUOTIENT Y X) 0)))
This conjecture simplifies, expanding ZEROP, EQUAL, and QUOTIENT, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-ZERO
(LEMMA QUOTIENT-ADD1
(REWRITE)
(IMPLIES (EQUAL (REMAINDER A B) 0)
(EQUAL (QUOTIENT (ADD1 A) B)
(IF (EQUAL B 1)
(ADD1 (QUOTIENT A B))
(QUOTIENT A B))))
((ENABLE QUOTIENT-NOOP)
(ENABLE-THEORY ADDITION)
(INDUCT (REMAINDER A B))))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to three new goals:
Case 3. (IMPLIES (AND (ZEROP B)
(EQUAL (REMAINDER A B) 0))
(EQUAL (QUOTIENT (ADD1 A) B)
(IF (EQUAL B 1)
(ADD1 (QUOTIENT A B))
(QUOTIENT A B)))),
which simplifies, rewriting with the lemma SUB1-TYPE-RESTRICTION, and
unfolding ZEROP, EQUAL, REMAINDER, ADD1, and QUOTIENT, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(LESSP A B)
(EQUAL (REMAINDER A B) 0))
(EQUAL (QUOTIENT (ADD1 A) B)
(IF (EQUAL B 1)
(ADD1 (QUOTIENT A B))
(QUOTIENT A B)))),
which simplifies, using linear arithmetic, rewriting with
DIFFERENCE-LEQ-ARG1, SUB1-TYPE-RESTRICTION, and QUOTIENT-NOOP, and opening
up the functions REMAINDER, ADD1, QUOTIENT, LESSP, and EQUAL, to the
following four new formulas:
Case 2.4.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(LESSP A B)
(EQUAL A 0)
(NOT (EQUAL B 1)))
(LESSP 1 B)).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(LESSP A B)
(EQUAL A 0)
(EQUAL B 1))
(NOT (LESSP 1 B))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(LESSP A B)
(NOT (NUMBERP A))
(NOT (EQUAL B 1)))
(LESSP 1 B)),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(LESSP A B)
(NOT (NUMBERP A))
(EQUAL B 1))
(NOT (LESSP 1 B))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(IMPLIES (EQUAL (REMAINDER (DIFFERENCE A B) B)
0)
(EQUAL (QUOTIENT (ADD1 (DIFFERENCE A B)) B)
(IF (EQUAL B 1)
(ADD1 (QUOTIENT (DIFFERENCE A B) B))
(QUOTIENT (DIFFERENCE A B) B))))
(EQUAL (REMAINDER A B) 0))
(EQUAL (QUOTIENT (ADD1 A) B)
(IF (EQUAL B 1)
(ADD1 (QUOTIENT A B))
(QUOTIENT A B)))),
which simplifies, applying DIFFERENCE-ADD1-ARG2, QUOTIENT-NOOP, and
SUB1-TYPE-RESTRICTION, and opening up the definitions of EQUAL, LESSP,
DIFFERENCE, IMPLIES, REMAINDER, QUOTIENT, ADD1, and NUMBERP, to:
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(NOT (EQUAL B 1))
(EQUAL (QUOTIENT (ADD1 (DIFFERENCE A B)) B)
(QUOTIENT (DIFFERENCE A B) B))
(EQUAL (REMAINDER (DIFFERENCE A B) B)
0))
(EQUAL (QUOTIENT (ADD1 A) B)
(ADD1 (QUOTIENT (DIFFERENCE A B) B)))).
Applying the lemma DIFFERENCE-ELIM, replace A by (PLUS B X) to eliminate
(DIFFERENCE A B). We rely upon the type restriction lemma noted when
DIFFERENCE was introduced to restrict the new variable. This produces the
following two new conjectures:
Case 1.2.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(NOT (EQUAL B 1))
(EQUAL (QUOTIENT (ADD1 (DIFFERENCE A B)) B)
(QUOTIENT (DIFFERENCE A B) B))
(EQUAL (REMAINDER (DIFFERENCE A B) B)
0))
(EQUAL (QUOTIENT (ADD1 A) B)
(ADD1 (QUOTIENT (DIFFERENCE A B) B)))).
This further simplifies, opening up the definition of LESSP, to:
T.
Case 1.1.
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (PLUS B X) B))
(NOT (EQUAL B 1))
(EQUAL (QUOTIENT (ADD1 X) B)
(QUOTIENT X B))
(EQUAL (REMAINDER X B) 0))
(EQUAL (QUOTIENT (ADD1 (PLUS B X)) B)
(ADD1 (QUOTIENT X B)))),
which further simplifies, rewriting with CORRECTNESS-OF-CANCEL-LESSP-PLUS,
DIFFERENCE-SUB1-ARG2, CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and SUB1-ADD1,
and opening up FIX, DIFFERENCE, LESSP, and QUOTIENT, to:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL B 1))
(EQUAL (QUOTIENT (ADD1 X) B)
(QUOTIENT X B))
(EQUAL (REMAINDER X B) 0)
(LESSP (PLUS B X) (SUB1 B)))
(EQUAL 0 (ADD1 (QUOTIENT X B)))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.2 0.1 ]
QUOTIENT-ADD1
(LEMMA EQUAL-QUOTIENT-0
(REWRITE)
(EQUAL (EQUAL (QUOTIENT A B) 0)
(OR (ZEROP B) (LESSP A B)))
((INDUCT (QUOTIENT A B))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, OR, and
AND, to three new goals:
Case 3. (IMPLIES (ZEROP B)
(EQUAL (EQUAL (QUOTIENT A B) 0)
(OR (ZEROP B) (LESSP A B)))),
which simplifies, opening up ZEROP, EQUAL, QUOTIENT, LESSP, and OR, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(LESSP A B))
(EQUAL (EQUAL (QUOTIENT A B) 0)
(OR (ZEROP B) (LESSP A B)))),
which simplifies, unfolding the functions QUOTIENT, EQUAL, ZEROP, and OR, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(EQUAL (EQUAL (QUOTIENT (DIFFERENCE A B) B)
0)
(OR (ZEROP B)
(LESSP (DIFFERENCE A B) B))))
(EQUAL (EQUAL (QUOTIENT A B) 0)
(OR (ZEROP B) (LESSP A B)))),
which simplifies, opening up ZEROP, OR, QUOTIENT, EQUAL, and ADD1, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-QUOTIENT-0
(LEMMA QUOTIENT-SUB1
(REWRITE)
(IMPLIES (AND (NOT (ZEROP A)) (NOT (ZEROP B)))
(EQUAL (QUOTIENT (SUB1 A) B)
(IF (EQUAL (REMAINDER A B) 0)
(SUB1 (QUOTIENT A B))
(QUOTIENT A B))))
((ENABLE QUOTIENT-NOOP EQUAL-QUOTIENT-0)
(ENABLE-THEORY ADDITION)
(INDUCT (REMAINDER A B))))
This formula can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to the following three new goals:
Case 3. (IMPLIES (AND (ZEROP B)
(NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B))
(EQUAL (QUOTIENT (SUB1 A) B)
(IF (EQUAL (REMAINDER A B) 0)
(SUB1 (QUOTIENT A B))
(QUOTIENT A B)))).
This simplifies, unfolding ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(LESSP A B)
(NOT (EQUAL A 0))
(NUMBERP A))
(EQUAL (QUOTIENT (SUB1 A) B)
(IF (EQUAL (REMAINDER A B) 0)
(SUB1 (QUOTIENT A B))
(QUOTIENT A B)))).
This simplifies, using linear arithmetic, appealing to the lemma
DIFFERENCE-LEQ-ARG1, and unfolding the definitions of QUOTIENT, LESSP, EQUAL,
ADD1, and REMAINDER, to:
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(LESSP A B)
(NOT (EQUAL A 0))
(NUMBERP A))
(LESSP (SUB1 A) B)),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(IMPLIES (AND (NOT (ZEROP (DIFFERENCE A B)))
(NOT (ZEROP B)))
(EQUAL (QUOTIENT (SUB1 (DIFFERENCE A B)) B)
(IF (EQUAL (REMAINDER (DIFFERENCE A B) B)
0)
(SUB1 (QUOTIENT (DIFFERENCE A B) B))
(QUOTIENT (DIFFERENCE A B) B))))
(NOT (EQUAL A 0))
(NUMBERP A))
(EQUAL (QUOTIENT (SUB1 A) B)
(IF (EQUAL (REMAINDER A B) 0)
(SUB1 (QUOTIENT A B))
(QUOTIENT A B)))),
which simplifies, rewriting with EQUAL-DIFFERENCE-0, DIFFERENCE-LEQ-ARG1,
EQUAL-QUOTIENT-0, and SUB1-ADD1, and opening up the definitions of ZEROP,
NOT, AND, IMPLIES, REMAINDER, NUMBERP, LESSP, EQUAL, QUOTIENT, ADD1, and
SUB1, to the following three new conjectures:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(NOT (LESSP B A))
(NOT (EQUAL A 0))
(NUMBERP A))
(LESSP (SUB1 A) B)).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(NOT (EQUAL (REMAINDER (DIFFERENCE A B) B)
0))
(EQUAL (QUOTIENT (SUB1 (DIFFERENCE A B)) B)
(QUOTIENT (DIFFERENCE A B) B))
(NOT (EQUAL A 0))
(NUMBERP A))
(EQUAL (QUOTIENT (SUB1 A) B)
(ADD1 (QUOTIENT (DIFFERENCE A B) B)))).
Applying the lemmas DIFFERENCE-ELIM and SUB1-ELIM, replace A by (PLUS B X)
to eliminate (DIFFERENCE A B) and X by (ADD1 Z) to eliminate (SUB1 X). We
employ the type restriction lemma noted when DIFFERENCE was introduced and
the type restriction lemma noted when SUB1 was introduced to restrict the
new variables. We thus obtain the following two new formulas:
Case 1.2.2.
(IMPLIES (AND (EQUAL X 0)
(NUMBERP X)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (PLUS B X) B))
(NOT (EQUAL (REMAINDER X B) 0))
(EQUAL (QUOTIENT (SUB1 X) B)
(QUOTIENT X B))
(NOT (EQUAL (PLUS B X) 0)))
(EQUAL (QUOTIENT (SUB1 (PLUS B X)) B)
(ADD1 (QUOTIENT X B)))).
However this further simplifies, rewriting with PLUS-ZERO-ARG2, and
unfolding the definitions of NUMBERP, ZEROP, LESSP, EQUAL, and REMAINDER,
to:
T.
Case 1.2.1.
(IMPLIES (AND (NUMBERP Z)
(NOT (EQUAL (ADD1 Z) 0))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (PLUS B (ADD1 Z)) B))
(NOT (EQUAL (REMAINDER (ADD1 Z) B) 0))
(EQUAL (QUOTIENT Z B)
(QUOTIENT (ADD1 Z) B))
(NOT (EQUAL (PLUS B (ADD1 Z)) 0)))
(EQUAL (QUOTIENT (SUB1 (PLUS B (ADD1 Z))) B)
(ADD1 (QUOTIENT (ADD1 Z) B)))).
However this further simplifies, applying the lemmas PLUS-ADD1-ARG2,
SUB1-ADD1, CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and
CORRECTNESS-OF-CANCEL-LESSP-PLUS, and opening up LESSP, FIX, and
QUOTIENT, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(EQUAL (REMAINDER (DIFFERENCE A B) B)
0)
(EQUAL (QUOTIENT (SUB1 (DIFFERENCE A B)) B)
(SUB1 (QUOTIENT (DIFFERENCE A B) B)))
(NOT (EQUAL A 0))
(NUMBERP A))
(EQUAL (QUOTIENT (SUB1 A) B)
(QUOTIENT (DIFFERENCE A B) B))).
Applying the lemmas DIFFERENCE-ELIM and SUB1-ELIM, replace A by (PLUS B X)
to eliminate (DIFFERENCE A B) and X by (ADD1 Z) to eliminate (SUB1 X). We
use the type restriction lemma noted when DIFFERENCE was introduced and
the type restriction lemma noted when SUB1 was introduced to restrict the
new variables. We thus obtain the following two new conjectures:
Case 1.1.2.
(IMPLIES (AND (EQUAL X 0)
(NUMBERP X)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (PLUS B X) B))
(EQUAL (REMAINDER X B) 0)
(EQUAL (QUOTIENT (SUB1 X) B)
(SUB1 (QUOTIENT X B)))
(NOT (EQUAL (PLUS B X) 0)))
(EQUAL (QUOTIENT (SUB1 (PLUS B X)) B)
(QUOTIENT X B))).
However this further simplifies, using linear arithmetic, applying the
lemmas PLUS-ZERO-ARG2 and DIFFERENCE-LEQ-ARG1, and expanding NUMBERP,
ZEROP, LESSP, EQUAL, REMAINDER, SUB1, QUOTIENT, and ADD1, to:
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP B B)))
(LESSP (SUB1 B) B)).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.1.1.
(IMPLIES (AND (NUMBERP Z)
(NOT (EQUAL (ADD1 Z) 0))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (PLUS B (ADD1 Z)) B))
(EQUAL (REMAINDER (ADD1 Z) B) 0)
(EQUAL (QUOTIENT Z B)
(SUB1 (QUOTIENT (ADD1 Z) B)))
(NOT (EQUAL (PLUS B (ADD1 Z)) 0)))
(EQUAL (QUOTIENT (SUB1 (PLUS B (ADD1 Z))) B)
(QUOTIENT (ADD1 Z) B))),
which further simplifies, rewriting with PLUS-ADD1-ARG2, SUB1-ADD1,
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and
CORRECTNESS-OF-CANCEL-LESSP-PLUS, and unfolding the definitions of LESSP,
FIX, and QUOTIENT, to:
(IMPLIES (AND (NUMBERP Z)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (PLUS B Z) (SUB1 B)))
(EQUAL (REMAINDER (ADD1 Z) B) 0)
(EQUAL (QUOTIENT Z B)
(SUB1 (QUOTIENT (ADD1 Z) B))))
(EQUAL (ADD1 (QUOTIENT Z B))
(QUOTIENT (ADD1 Z) B))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (EQUAL (QUOTIENT (ADD1 Z) B) 0)
(NUMBERP Z)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (PLUS B Z) (SUB1 B)))
(EQUAL (REMAINDER (ADD1 Z) B) 0)
(EQUAL (QUOTIENT Z B)
(SUB1 (QUOTIENT (ADD1 Z) B))))
(EQUAL (ADD1 (QUOTIENT Z B))
(QUOTIENT (ADD1 Z) B))).
But this again simplifies, rewriting with SUB1-ADD1 and EQUAL-QUOTIENT-0,
and opening up the definitions of LESSP and REMAINDER, to:
T.
Q.E.D.
[ 0.0 0.5 0.0 ]
QUOTIENT-SUB1
(LEMMA QUOTIENT-PLUS-PROOF NIL
(IMPLIES (EQUAL (REMAINDER B C) 0)
(EQUAL (QUOTIENT (PLUS A B) C)
(PLUS (QUOTIENT A C) (QUOTIENT B C))))
((ENABLE REMAINDER-NOOP)
(ENABLE-THEORY ADDITION)
(INDUCT (REMAINDER B C))))
This formula can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to the following three new formulas:
Case 3. (IMPLIES (AND (ZEROP C)
(EQUAL (REMAINDER B C) 0))
(EQUAL (QUOTIENT (PLUS A B) C)
(PLUS (QUOTIENT A C)
(QUOTIENT B C)))).
This simplifies, appealing to the lemma PLUS-ZERO-ARG2, and unfolding ZEROP,
EQUAL, REMAINDER, QUOTIENT, and PLUS, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(EQUAL (REMAINDER B C) 0))
(EQUAL (QUOTIENT (PLUS A B) C)
(PLUS (QUOTIENT A C)
(QUOTIENT B C)))).
This simplifies, applying the lemmas REMAINDER-NOOP and PLUS-ZERO-ARG2, and
opening up the functions ZEROP, LESSP, EQUAL, and QUOTIENT, to the following
two new goals:
Case 2.2.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(EQUAL B 0)
(NOT (NUMBERP A)))
(EQUAL (QUOTIENT 0 C)
(QUOTIENT A C))).
This again simplifies, unfolding EQUAL, LESSP, and QUOTIENT, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP B C)
(NOT (NUMBERP B))
(NOT (NUMBERP A)))
(EQUAL (QUOTIENT 0 C)
(QUOTIENT A C))),
which again simplifies, unfolding the functions LESSP, EQUAL, and QUOTIENT,
to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(IMPLIES (EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(EQUAL (QUOTIENT (PLUS A (DIFFERENCE B C)) C)
(PLUS (QUOTIENT A C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL (REMAINDER B C) 0))
(EQUAL (QUOTIENT (PLUS A B) C)
(PLUS (QUOTIENT A C)
(QUOTIENT B C)))),
which simplifies, using linear arithmetic, applying PLUS-ZERO-ARG2,
PLUS-DIFFERENCE-ARG2, REMAINDER-NOOP, DIFFERENCE-LEQ-ARG1, and
PLUS-ADD1-ARG2, and expanding the definitions of ZEROP, IMPLIES, REMAINDER,
NUMBERP, EQUAL, QUOTIENT, LESSP, ADD1, and PLUS, to the following four new
goals:
Case 1.4.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(NUMBERP A)
(EQUAL (QUOTIENT A C)
(PLUS (QUOTIENT A C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL (QUOTIENT (PLUS A B) C)
(ADD1 (QUOTIENT A C)))).
This again simplifies, using linear arithmetic, to two new formulas:
Case 1.4.2.
(IMPLIES (AND (NOT (NUMBERP B))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(NUMBERP A)
(EQUAL (QUOTIENT A C)
(PLUS (QUOTIENT A C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL (QUOTIENT (PLUS A B) C)
(ADD1 (QUOTIENT A C)))),
which again simplifies, opening up LESSP, to:
T.
Case 1.4.1.
(IMPLIES (AND (NUMBERP B)
(NOT (EQUAL B 0))
(NOT (LESSP B B))
(NOT (LESSP B B))
(NUMBERP A)
(EQUAL (QUOTIENT A B)
(PLUS (QUOTIENT A B)
(QUOTIENT (DIFFERENCE B B) B))))
(EQUAL (QUOTIENT (PLUS A B) B)
(ADD1 (QUOTIENT A B)))),
which again simplifies, rewriting with DIFFERENCE-X-X, PLUS-ZERO-ARG2,
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and
CORRECTNESS-OF-CANCEL-LESSP-PLUS, and opening up the functions LESSP,
EQUAL, QUOTIENT, ZEROP, and FIX, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(NOT (NUMBERP A))
(EQUAL (QUOTIENT 0 C)
(PLUS (QUOTIENT A C)
(QUOTIENT (DIFFERENCE B C) C)))
(NOT (NUMBERP B)))
(EQUAL (QUOTIENT 0 C) 1)).
This again simplifies, unfolding the definition of LESSP, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(NOT (LESSP C B))
(NOT (NUMBERP A))
(EQUAL (QUOTIENT 0 C)
(PLUS (QUOTIENT A C)
(QUOTIENT (DIFFERENCE B C) C)))
(NUMBERP B))
(EQUAL (QUOTIENT B C) 1)),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP B B))
(NOT (LESSP B B))
(NOT (NUMBERP A))
(EQUAL (QUOTIENT 0 B)
(PLUS (QUOTIENT A B)
(QUOTIENT (DIFFERENCE B B) B)))
(NUMBERP B))
(EQUAL (QUOTIENT B B) 1)).
This again simplifies, rewriting with DIFFERENCE-X-X, and opening up the
functions LESSP, EQUAL, QUOTIENT, PLUS, and ADD1, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(LESSP C B)
(EQUAL (QUOTIENT (DIFFERENCE (PLUS A B) C) C)
(PLUS (QUOTIENT A C)
(QUOTIENT (DIFFERENCE B C) C)))
(EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(EQUAL (QUOTIENT (PLUS A B) C)
(ADD1 (QUOTIENT (DIFFERENCE (PLUS A B) C)
C)))).
But this again simplifies, opening up the function QUOTIENT, to the
formula:
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP B C))
(LESSP C B)
(EQUAL (QUOTIENT (DIFFERENCE (PLUS A B) C) C)
(PLUS (QUOTIENT A C)
(QUOTIENT (DIFFERENCE B C) C)))
(EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(LESSP (PLUS A B) C))
(EQUAL 0
(ADD1 (QUOTIENT (DIFFERENCE (PLUS A B) C)
C)))).
This again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.2 0.0 ]
QUOTIENT-PLUS-PROOF
(LEMMA QUOTIENT-PLUS
(REWRITE)
(IMPLIES (EQUAL (REMAINDER A C) 0)
(AND (EQUAL (QUOTIENT (PLUS A B) C)
(PLUS (QUOTIENT A C) (QUOTIENT B C)))
(EQUAL (QUOTIENT (PLUS B A) C)
(PLUS (QUOTIENT A C) (QUOTIENT B C)))
(EQUAL (QUOTIENT (PLUS X Y A) C)
(PLUS (QUOTIENT (PLUS X Y) C)
(QUOTIENT A C)))))
((USE (QUOTIENT-PLUS-PROOF (A B)
(B A)
(C C))
(QUOTIENT-PLUS-PROOF (A A)
(B B)
(C C))
(QUOTIENT-PLUS-PROOF (A (PLUS X Y))
(B A)
(C C)))
(ENABLE COMMUTATIVITY-OF-PLUS COMMUTATIVITY2-OF-PLUS
ASSOCIATIVITY-OF-PLUS)
(DO-NOT-INDUCT T)))
WARNING: Note that the proposed lemma QUOTIENT-PLUS is to be stored as zero
type prescription rules, zero compound recognizer rules, zero linear rules,
and three replacement rules.
This conjecture can be simplified, using the abbreviations IMPLIES, AND, and
ASSOCIATIVITY-OF-PLUS, to:
(IMPLIES (AND (IMPLIES (EQUAL (REMAINDER A C) 0)
(EQUAL (QUOTIENT (PLUS B A) C)
(PLUS (QUOTIENT B C) (QUOTIENT A C))))
(IMPLIES (EQUAL (REMAINDER B C) 0)
(EQUAL (QUOTIENT (PLUS A B) C)
(PLUS (QUOTIENT A C) (QUOTIENT B C))))
(IMPLIES (EQUAL (REMAINDER A C) 0)
(EQUAL (QUOTIENT (PLUS X Y A) C)
(PLUS (QUOTIENT (PLUS X Y) C)
(QUOTIENT A C))))
(EQUAL (REMAINDER A C) 0))
(AND (EQUAL (QUOTIENT (PLUS A B) C)
(PLUS (QUOTIENT A C) (QUOTIENT B C)))
(EQUAL (QUOTIENT (PLUS B A) C)
(PLUS (QUOTIENT A C) (QUOTIENT B C)))
(EQUAL (QUOTIENT (PLUS X Y A) C)
(PLUS (QUOTIENT (PLUS X Y) C)
(QUOTIENT A C))))).
This simplifies, rewriting with the lemmas COMMUTATIVITY-OF-PLUS and
COMMUTATIVITY2-OF-PLUS, and expanding the definitions of EQUAL, IMPLIES, and
AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-PLUS
(LEMMA QUOTIENT-TIMES-INSTANCE-TEMP-PROOF NIL
(EQUAL (QUOTIENT (TIMES Y X) Y)
(IF (ZEROP Y) 0 (FIX X)))
((ENABLE TIMES-ZERO COMMUTATIVITY-OF-TIMES
DIFFERENCE-PLUS-CANCELLATION)))
This conjecture simplifies, applying COMMUTATIVITY-OF-TIMES, and expanding the
functions ZEROP and FIX, to four new conjectures:
Case 4. (IMPLIES (EQUAL Y 0)
(EQUAL (QUOTIENT (TIMES X Y) Y) 0)),
which again simplifies, applying COMMUTATIVITY-OF-TIMES, and opening up
EQUAL, TIMES, and QUOTIENT, to:
T.
Case 3. (IMPLIES (NOT (NUMBERP Y))
(EQUAL (QUOTIENT (TIMES X Y) Y) 0)).
This again simplifies, applying TIMES-ZERO, and opening up the functions
ZEROP, QUOTIENT, and EQUAL, to:
T.
Case 2. (IMPLIES (NOT (NUMBERP X))
(EQUAL (QUOTIENT (TIMES X Y) Y) 0)).
However this again simplifies, unfolding the definitions of TIMES, LESSP,
EQUAL, and QUOTIENT, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP X))
(EQUAL (QUOTIENT (TIMES X Y) Y) X)),
which we will name *1.
We will appeal to induction. There is only one plausible induction. We
will induct according to the following scheme:
(AND (IMPLIES (ZEROP X) (p X Y))
(IMPLIES (AND (NOT (ZEROP X)) (p (SUB1 X) Y))
(p X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to establish that the measure (COUNT X) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme generates two new goals:
Case 2. (IMPLIES (AND (ZEROP X)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP X))
(EQUAL (QUOTIENT (TIMES X Y) Y) X)),
which simplifies, opening up ZEROP, NUMBERP, EQUAL, TIMES, LESSP, and
QUOTIENT, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(EQUAL (QUOTIENT (TIMES (SUB1 X) Y) Y)
(SUB1 X))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP X))
(EQUAL (QUOTIENT (TIMES X Y) Y) X)),
which simplifies, rewriting with ADD1-SUB1 and DIFFERENCE-PLUS-CANCELLATION,
and expanding the functions ZEROP, TIMES, and QUOTIENT, to the new formula:
(IMPLIES (AND (NOT (EQUAL X 0))
(EQUAL (QUOTIENT (TIMES (SUB1 X) Y) Y)
(SUB1 X))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP X))
(NOT (LESSP (PLUS Y (TIMES (SUB1 X) Y))
Y))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-TIMES-INSTANCE-TEMP-PROOF
(LEMMA QUOTIENT-TIMES-INSTANCE-TEMP
(REWRITE)
(AND (EQUAL (QUOTIENT (TIMES Y X) Y)
(IF (ZEROP Y) 0 (FIX X)))
(EQUAL (QUOTIENT (TIMES X Y) Y)
(IF (ZEROP Y) 0 (FIX X))))
((USE (QUOTIENT-TIMES-INSTANCE-TEMP-PROOF (X X)
(Y Y))
(QUOTIENT-TIMES-INSTANCE-TEMP-PROOF (X Y)
(Y X)))
(ENABLE COMMUTATIVITY-OF-TIMES)))
WARNING: Note that the proposed lemma QUOTIENT-TIMES-INSTANCE-TEMP is to be
stored as zero type prescription rules, zero compound recognizer rules, zero
linear rules, and two replacement rules.
This simplifies, appealing to the lemma COMMUTATIVITY-OF-TIMES, and unfolding
the definitions of ZEROP, FIX, EQUAL, TIMES, LESSP, QUOTIENT, and AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-TIMES-INSTANCE-TEMP
(DISABLE QUOTIENT-TIMES-INSTANCE-TEMP)
[ 0.0 0.0 0.0 ]
QUOTIENT-TIMES-INSTANCE-TEMP-OFF
(LEMMA QUOTIENT-TIMES-PROOF NIL
(IMPLIES (EQUAL (REMAINDER A C) 0)
(EQUAL (QUOTIENT (TIMES A B) C)
(TIMES B (QUOTIENT A C))))
((ENABLE-THEORY ADDITION MULTIPLICATION REMAINDERS)
(ENABLE QUOTIENT-PLUS QUOTIENT-NOOP EQUAL-QUOTIENT-0
QUOTIENT-TIMES-INSTANCE-TEMP)
(INDUCT (REMAINDER A C))))
This formula can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to the following three new goals:
Case 3. (IMPLIES (AND (ZEROP C)
(EQUAL (REMAINDER A C) 0))
(EQUAL (QUOTIENT (TIMES A B) C)
(TIMES B (QUOTIENT A C)))).
This simplifies, applying the lemmas REMAINDER-ZERO and
COMMUTATIVITY-OF-TIMES, and unfolding the definitions of ZEROP, EQUAL, TIMES,
and QUOTIENT, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP A C)
(EQUAL (REMAINDER A C) 0))
(EQUAL (QUOTIENT (TIMES A B) C)
(TIMES B (QUOTIENT A C)))).
This simplifies, rewriting with REMAINDER-NOOP and COMMUTATIVITY-OF-TIMES,
and unfolding the functions EQUAL, TIMES, LESSP, and QUOTIENT, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(IMPLIES (EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(EQUAL (QUOTIENT (TIMES (DIFFERENCE A C) B)
C)
(TIMES B
(QUOTIENT (DIFFERENCE A C) C))))
(EQUAL (REMAINDER A C) 0))
(EQUAL (QUOTIENT (TIMES A B) C)
(TIMES B (QUOTIENT A C)))),
which simplifies, rewriting with the lemmas COMMUTATIVITY-OF-TIMES,
TIMES-DISTRIBUTES-OVER-DIFFERENCE, and TIMES-ADD1, and opening up the
definitions of IMPLIES, REMAINDER, and QUOTIENT, to:
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(EQUAL (QUOTIENT (DIFFERENCE (TIMES A B) (TIMES B C))
C)
(TIMES B
(QUOTIENT (DIFFERENCE A C) C)))
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(EQUAL (QUOTIENT (TIMES A B) C)
(PLUS B
(TIMES B
(QUOTIENT (DIFFERENCE A C) C))))).
Appealing to the lemmas DIFFERENCE-ELIM and REMAINDER-QUOTIENT-ELIM, we now
replace A by (PLUS C X) to eliminate (DIFFERENCE A C) and X by
(PLUS V (TIMES C Z)) to eliminate (QUOTIENT X C) and (REMAINDER X C). We
use the type restriction lemma noted when DIFFERENCE was introduced,
LESSP-REMAINDER, the type restriction lemma noted when QUOTIENT was
introduced, and the type restriction lemma noted when REMAINDER was
introduced to constrain the new variables. We must thus prove two new
conjectures:
Case 1.2.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(EQUAL (QUOTIENT (DIFFERENCE (TIMES A B) (TIMES B C))
C)
(TIMES B
(QUOTIENT (DIFFERENCE A C) C)))
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(EQUAL (QUOTIENT (TIMES A B) C)
(PLUS B
(TIMES B
(QUOTIENT (DIFFERENCE A C) C))))),
which further simplifies, opening up the definition of LESSP, to:
T.
Case 1.1.
(IMPLIES
(AND (NUMBERP Z)
(NUMBERP V)
(EQUAL (LESSP V C) (NOT (ZEROP C)))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (PLUS C V (TIMES C Z)) C))
(EQUAL (QUOTIENT (DIFFERENCE (TIMES (PLUS C V (TIMES C Z)) B)
(TIMES B C))
C)
(TIMES B Z))
(EQUAL V 0))
(EQUAL (QUOTIENT (TIMES (PLUS C V (TIMES C Z)) B)
C)
(PLUS B (TIMES B Z)))),
which further simplifies, rewriting with the lemmas LESSP-PLUS-TIMES1,
COMMUTATIVITY-OF-TIMES, COMMUTATIVITY2-OF-TIMES, ASSOCIATIVITY-OF-TIMES,
TIMES-DISTRIBUTES-OVER-PLUS, CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS,
REMAINDER-TIMES1, REMAINDER-TIMES1-INSTANCE, QUOTIENT-TIMES-INSTANCE-TEMP,
QUOTIENT-PLUS, and CORRECTNESS-OF-CANCEL-EQUAL-PLUS, and expanding the
definitions of NUMBERP, EQUAL, LESSP, ZEROP, NOT, PLUS, and FIX, to:
T.
Q.E.D.
[ 0.0 1.1 0.0 ]
QUOTIENT-TIMES-PROOF
(LEMMA QUOTIENT-TIMES
(REWRITE)
(IMPLIES (EQUAL (REMAINDER A C) 0)
(AND (EQUAL (QUOTIENT (TIMES A B) C)
(TIMES B (QUOTIENT A C)))
(EQUAL (QUOTIENT (TIMES B A) C)
(TIMES B (QUOTIENT A C)))))
((ENABLE COMMUTATIVITY-OF-TIMES)
(USE (QUOTIENT-TIMES-PROOF (A A)
(B B)
(C C)))
(DO-NOT-INDUCT T)))
WARNING: Note that the proposed lemma QUOTIENT-TIMES is to be stored as zero
type prescription rules, zero compound recognizer rules, zero linear rules,
and two replacement rules.
This formula simplifies, rewriting with the lemma COMMUTATIVITY-OF-TIMES, and
opening up EQUAL, IMPLIES, and AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-TIMES
(LEMMA QUOTIENT-TIMES-INSTANCE
(REWRITE)
(AND (EQUAL (QUOTIENT (TIMES Y X) Y)
(IF (ZEROP Y) 0 (FIX X)))
(EQUAL (QUOTIENT (TIMES X Y) Y)
(IF (ZEROP Y) 0 (FIX X))))
((ENABLE QUOTIENT-TIMES-INSTANCE-TEMP)))
WARNING: Note that the proposed lemma QUOTIENT-TIMES-INSTANCE is to be stored
as zero type prescription rules, zero compound recognizer rules, zero linear
rules, and two replacement rules.
This formula can be simplified, using the abbreviation AND, to the following
two new goals:
Case 2. (EQUAL (QUOTIENT (TIMES Y X) Y)
(IF (ZEROP Y) 0 (FIX X))).
This simplifies, applying QUOTIENT-TIMES-INSTANCE-TEMP, and unfolding the
definitions of ZEROP and FIX, to:
T.
Case 1. (EQUAL (QUOTIENT (TIMES X Y) Y)
(IF (ZEROP Y) 0 (FIX X))),
which simplifies, appealing to the lemma QUOTIENT-TIMES-INSTANCE-TEMP, and
unfolding the definitions of ZEROP and FIX, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-TIMES-INSTANCE
(LEMMA QUOTIENT-TIMES-TIMES-PROOF NIL
(EQUAL (QUOTIENT (TIMES X Y) (TIMES X Z))
(IF (ZEROP X) 0 (QUOTIENT Y Z)))
((ENABLE-THEORY ADDITION)
(ENABLE LESSP-TIMES-CANCELLATION1 EQUAL-TIMES-0 TIMES-ZERO
COMMUTATIVITY-OF-TIMES TIMES-DISTRIBUTES-OVER-DIFFERENCE)
(INDUCT (QUOTIENT Y Z))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, OR, and
AND, to three new formulas:
Case 3. (IMPLIES (ZEROP Z)
(EQUAL (QUOTIENT (TIMES X Y) (TIMES X Z))
(IF (ZEROP X) 0 (QUOTIENT Y Z)))),
which simplifies, applying COMMUTATIVITY-OF-TIMES and TIMES-ZERO, and
opening up the definitions of ZEROP, EQUAL, TIMES, and QUOTIENT, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL Z 0))
(NUMBERP Z)
(LESSP Y Z))
(EQUAL (QUOTIENT (TIMES X Y) (TIMES X Z))
(IF (ZEROP X) 0 (QUOTIENT Y Z)))).
This simplifies, using linear arithmetic, applying DIFFERENCE-LEQ-ARG1,
LESSP-TIMES-CANCELLATION1, and EQUAL-TIMES-0, and unfolding the definitions
of QUOTIENT, LESSP, EQUAL, ADD1, and ZEROP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y Z))
(EQUAL (QUOTIENT (TIMES X (DIFFERENCE Y Z))
(TIMES X Z))
(IF (ZEROP X)
0
(QUOTIENT (DIFFERENCE Y Z) Z))))
(EQUAL (QUOTIENT (TIMES X Y) (TIMES X Z))
(IF (ZEROP X) 0 (QUOTIENT Y Z)))),
which simplifies, rewriting with the lemmas
TIMES-DISTRIBUTES-OVER-DIFFERENCE, LESSP-TIMES-CANCELLATION1, and
EQUAL-TIMES-0, and unfolding the definitions of ZEROP, TIMES, QUOTIENT, and
EQUAL, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
QUOTIENT-TIMES-TIMES-PROOF
(LEMMA QUOTIENT-TIMES-TIMES
(REWRITE)
(AND (EQUAL (QUOTIENT (TIMES X Y) (TIMES X Z))
(IF (ZEROP X) 0 (QUOTIENT Y Z)))
(EQUAL (QUOTIENT (TIMES X Z) (TIMES Y Z))
(IF (ZEROP Z) 0 (QUOTIENT X Y))))
((USE (QUOTIENT-TIMES-TIMES-PROOF (X X)
(Y Y)
(Z Z))
(QUOTIENT-TIMES-TIMES-PROOF (X Z)
(Y X)
(Z Y)))
(ENABLE COMMUTATIVITY-OF-TIMES)))
WARNING: Note that the proposed lemma QUOTIENT-TIMES-TIMES is to be stored as
zero type prescription rules, zero compound recognizer rules, zero linear
rules, and two replacement rules.
This simplifies, applying COMMUTATIVITY-OF-TIMES, and opening up the
definitions of ZEROP, TIMES, LESSP, EQUAL, QUOTIENT, and AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-TIMES-TIMES
(DISABLE QUOTIENT-TIMES-TIMES)
[ 0.0 0.0 0.0 ]
QUOTIENT-TIMES-TIMES-OFF
(LEMMA QUOTIENT-DIFFERENCE1
(REWRITE)
(IMPLIES (EQUAL (REMAINDER A C)
(REMAINDER B C))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(DIFFERENCE (QUOTIENT A C)
(QUOTIENT B C))))
((ENABLE-THEORY ADDITION MULTIPLICATION REMAINDERS)
(ENABLE QUOTIENT-PLUS QUOTIENT-TIMES-INSTANCE
EQUAL-REMAINDER-PLUS-REMAINDER)
(DO-NOT-INDUCT T)))
.
Appealing to the lemmas DIFFERENCE-ELIM and REMAINDER-QUOTIENT-ELIM, we now
replace A by (PLUS B X) to eliminate (DIFFERENCE A B) and X by
(PLUS V (TIMES C Z)) to eliminate (QUOTIENT X C) and (REMAINDER X C). We
employ the type restriction lemma noted when DIFFERENCE was introduced,
LESSP-REMAINDER, the type restriction lemma noted when QUOTIENT was introduced,
and the type restriction lemma noted when REMAINDER was introduced to
constrain the new variables. This generates five new formulas:
Case 5. (IMPLIES (AND (LESSP A B)
(EQUAL (REMAINDER A C)
(REMAINDER B C)))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(DIFFERENCE (QUOTIENT A C)
(QUOTIENT B C)))),
which simplifies, using linear arithmetic, rewriting with
DIFFERENCE-LEQ-ARG1 and EQUAL-DIFFERENCE-0, and expanding the functions
LESSP, EQUAL, and QUOTIENT, to:
(IMPLIES (AND (LESSP A B)
(EQUAL (REMAINDER A C)
(REMAINDER B C)))
(NOT (LESSP (QUOTIENT B C)
(QUOTIENT A C)))).
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace A by
(PLUS X (TIMES C Z)) to eliminate (REMAINDER A C) and (QUOTIENT A C). We
use LESSP-REMAINDER, the type restriction lemma noted when REMAINDER was
introduced, and the type restriction lemma noted when QUOTIENT was
introduced to restrict the new variables. This produces the following four
new formulas:
Case 5.4.
(IMPLIES (AND (NOT (NUMBERP A))
(LESSP A B)
(EQUAL (REMAINDER A C)
(REMAINDER B C)))
(NOT (LESSP (QUOTIENT B C)
(QUOTIENT A C)))).
However this further simplifies, applying REMAINDER-OF-NON-NUMBER, and
opening up LESSP, EQUAL, NUMBERP, REMAINDER, and QUOTIENT, to:
T.
Case 5.3.
(IMPLIES (AND (EQUAL C 0)
(LESSP A B)
(EQUAL (REMAINDER A C)
(REMAINDER B C)))
(NOT (LESSP (QUOTIENT B C)
(QUOTIENT A C)))).
But this further simplifies, rewriting with the lemma REMAINDER-ZERO, and
expanding ZEROP, EQUAL, QUOTIENT, and LESSP, to:
T.
Case 5.2.
(IMPLIES (AND (NOT (NUMBERP C))
(LESSP A B)
(EQUAL (REMAINDER A C)
(REMAINDER B C)))
(NOT (LESSP (QUOTIENT B C)
(QUOTIENT A C)))),
which further simplifies, rewriting with the lemma REMAINDER-ZERO, and
expanding the functions ZEROP, QUOTIENT, and LESSP, to:
T.
Case 5.1.
(IMPLIES (AND (NUMBERP X)
(EQUAL (LESSP X C) (NOT (ZEROP C)))
(NUMBERP Z)
(NUMBERP C)
(NOT (EQUAL C 0))
(LESSP (PLUS X (TIMES C Z)) B)
(EQUAL X (REMAINDER B C)))
(NOT (LESSP (QUOTIENT B C) Z))),
which further simplifies, applying the lemma LESSP-REMAINDER, and
expanding ZEROP, NOT, and EQUAL, to:
(IMPLIES (AND (NUMBERP Z)
(NUMBERP C)
(NOT (EQUAL C 0))
(LESSP (PLUS (REMAINDER B C) (TIMES C Z))
B))
(NOT (LESSP (QUOTIENT B C) Z))).
Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace B by
(PLUS X (TIMES C V)) to eliminate (REMAINDER B C) and (QUOTIENT B C). We
employ LESSP-REMAINDER, the type restriction lemma noted when REMAINDER
was introduced, and the type restriction lemma noted when QUOTIENT was
introduced to constrain the new variables. We must thus prove two new
formulas:
Case 5.1.2.
(IMPLIES (AND (NOT (NUMBERP B))
(NUMBERP Z)
(NUMBERP C)
(NOT (EQUAL C 0))
(LESSP (PLUS (REMAINDER B C) (TIMES C Z))
B))
(NOT (LESSP (QUOTIENT B C) Z))),
which finally simplifies, using linear arithmetic, applying
REMAINDER-NOOP, REMAINDER-OF-NON-NUMBER, and LESSP-TIMES2, and opening
up the definitions of NUMBERP, EQUAL, and PLUS, to:
T.
Case 5.1.1.
(IMPLIES (AND (NUMBERP X)
(EQUAL (LESSP X C) (NOT (ZEROP C)))
(NUMBERP V)
(NUMBERP Z)
(NUMBERP C)
(NOT (EQUAL C 0))
(LESSP (PLUS X (TIMES C Z))
(PLUS X (TIMES C V))))
(NOT (LESSP V Z))).
But this further simplifies, rewriting with
CORRECTNESS-OF-CANCEL-LESSP-PLUS and CORRECTNESS-OF-CANCEL-LESSP-TIMES,
and opening up the definitions of ZEROP, NOT, FIX, and AND, to:
(IMPLIES (AND (NUMBERP X)
(LESSP X C)
(NUMBERP V)
(NUMBERP Z)
(NUMBERP C)
(NOT (EQUAL C 0))
(LESSP Z V))
(NOT (LESSP V Z))),
which finally simplifies, using linear arithmetic, to:
T.
Case 4. (IMPLIES (AND (NOT (NUMBERP A))
(EQUAL (REMAINDER A C)
(REMAINDER B C)))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(DIFFERENCE (QUOTIENT A C)
(QUOTIENT B C)))),
which simplifies, using linear arithmetic, applying REMAINDER-OF-NON-NUMBER
and DIFFERENCE-LEQ-ARG1, and expanding the functions LESSP, EQUAL, NUMBERP,
REMAINDER, and QUOTIENT, to:
T.
Case 3. (IMPLIES (AND (EQUAL C 0)
(NUMBERP X)
(NOT (LESSP (PLUS B X) B))
(EQUAL (REMAINDER (PLUS B X) C)
(REMAINDER B C)))
(EQUAL (QUOTIENT X C)
(DIFFERENCE (QUOTIENT (PLUS B X) C)
(QUOTIENT B C)))).
But this simplifies, rewriting with the lemmas
CORRECTNESS-OF-CANCEL-LESSP-PLUS and REMAINDER-ZERO, and opening up the
definitions of ZEROP, EQUAL, QUOTIENT, PLUS, and DIFFERENCE, to:
T.
Case 2. (IMPLIES (AND (NOT (NUMBERP C))
(NUMBERP X)
(NOT (LESSP (PLUS B X) B))
(EQUAL (REMAINDER (PLUS B X) C)
(REMAINDER B C)))
(EQUAL (QUOTIENT X C)
(DIFFERENCE (QUOTIENT (PLUS B X) C)
(QUOTIENT B C)))),
which simplifies, rewriting with CORRECTNESS-OF-CANCEL-LESSP-PLUS and
REMAINDER-ZERO, and opening up the definitions of ZEROP, QUOTIENT, PLUS,
DIFFERENCE, and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NUMBERP Z)
(NUMBERP V)
(EQUAL (LESSP V C) (NOT (ZEROP C)))
(NUMBERP C)
(NOT (EQUAL C 0))
(NOT (LESSP (PLUS B V (TIMES C Z)) B))
(EQUAL (REMAINDER (PLUS B V (TIMES C Z)) C)
(REMAINDER B C)))
(EQUAL Z
(DIFFERENCE (QUOTIENT (PLUS B V (TIMES C Z)) C)
(QUOTIENT B C)))).
However this simplifies, appealing to the lemmas
CORRECTNESS-OF-CANCEL-LESSP-PLUS, REMAINDER-TIMES1-INSTANCE, REMAINDER-PLUS,
EQUAL-REMAINDER-PLUS-REMAINDER, QUOTIENT-TIMES-INSTANCE, QUOTIENT-PLUS, and
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and opening up ZEROP, NOT, EQUAL,
PLUS, and FIX, to:
T.
Q.E.D.
[ 0.0 0.5 0.0 ]
QUOTIENT-DIFFERENCE1
(LEMMA QUOTIENT-LESSP-ARG1
(REWRITE)
(IMPLIES (LESSP A B)
(EQUAL (QUOTIENT A B) 0)))
This formula simplifies, expanding the functions QUOTIENT and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-LESSP-ARG1
(LEMMA QUOTIENT-DIFFERENCE2
(REWRITE)
(IMPLIES (AND (EQUAL (REMAINDER A C) 0)
(NOT (EQUAL (REMAINDER B C) 0)))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE (QUOTIENT A C)
(ADD1 (QUOTIENT B C)))
0)))
((ENABLE EQUAL-QUOTIENT-0 EQUAL-REMAINDER-PLUS-0
QUOTIENT-TIMES-INSTANCE QUOTIENT-ZERO)
(DISABLE TIMES-DISTRIBUTES-OVER-PLUS EQUAL-REMAINDER-DIFFERENCE-0
REMAINDER-DIFFERENCE3)
(ENABLE-THEORY ADDITION MULTIPLICATION REMAINDERS)
(INDUCT (DOUBLE-REMAINDER-INDUCTION A B C))))
This formula can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, AND, and DIFFERENCE-DIFFERENCE-ARG1, to the following four new goals:
Case 4. (IMPLIES (AND (ZEROP C)
(EQUAL (REMAINDER A C) 0)
(NOT (EQUAL (REMAINDER B C) 0)))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE (QUOTIENT A C)
(ADD1 (QUOTIENT B C)))
0))).
This simplifies, using linear arithmetic, rewriting with REMAINDER-ZERO,
DIFFERENCE-LEQ-ARG1, and QUOTIENT-ZERO, and opening up the definitions of
ZEROP, QUOTIENT, EQUAL, and LESSP, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP A C)
(EQUAL (REMAINDER A C) 0)
(NOT (EQUAL (REMAINDER B C) 0)))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE (QUOTIENT A C)
(ADD1 (QUOTIENT B C)))
0))),
which simplifies, using linear arithmetic, applying REMAINDER-NOOP and
DIFFERENCE-LEQ-ARG1, and opening up LESSP, EQUAL, and QUOTIENT, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(LESSP B C)
(EQUAL (REMAINDER A C) 0)
(NOT (EQUAL (REMAINDER B C) 0)))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE (QUOTIENT A C)
(ADD1 (QUOTIENT B C)))
0))).
This simplifies, rewriting with REMAINDER-NOOP, EQUAL-QUOTIENT-0, and
DIFFERENCE-ADD1-ARG2, and opening up the functions QUOTIENT, ADD1, EQUAL,
LESSP, and DIFFERENCE, to two new goals:
Case 2.2.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(LESSP B C)
(EQUAL (REMAINDER A C) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(NOT (LESSP B A)))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
0)),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(LESSP B C)
(EQUAL (REMAINDER A C) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(LESSP B A))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 (QUOTIENT A C)))).
Applying the lemmas DIFFERENCE-ELIM and REMAINDER-QUOTIENT-ELIM, replace A
by (PLUS B X) to eliminate (DIFFERENCE A B) and X by (PLUS V (TIMES C Z))
to eliminate (QUOTIENT X C) and (REMAINDER X C). We rely upon the type
restriction lemma noted when DIFFERENCE was introduced, LESSP-REMAINDER,
the type restriction lemma noted when QUOTIENT was introduced, and the
type restriction lemma noted when REMAINDER was introduced to restrict the
new variables. We would thus like to prove the following three new
formulas:
Case 2.1.3.
(IMPLIES (AND (LESSP A B)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(LESSP B C)
(EQUAL (REMAINDER A C) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(LESSP B A))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 (QUOTIENT A C)))).
But this further simplifies, using linear arithmetic, to:
T.
Case 2.1.2.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(LESSP B C)
(EQUAL (REMAINDER A C) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(LESSP B A))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 (QUOTIENT A C)))),
which further simplifies, unfolding the definition of LESSP, to:
T.
Case 2.1.1.
(IMPLIES (AND (NUMBERP Z)
(NUMBERP V)
(EQUAL (LESSP V C) (NOT (ZEROP C)))
(NOT (LESSP (PLUS B V (TIMES C Z)) B))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (PLUS B V (TIMES C Z)) C))
(LESSP B C)
(EQUAL (REMAINDER (PLUS B V (TIMES C Z)) C)
0)
(NUMBERP B)
(NOT (EQUAL B 0))
(LESSP B (PLUS B V (TIMES C Z))))
(EQUAL Z
(SUB1 (QUOTIENT (PLUS B V (TIMES C Z))