(NOTE-LIB "bags" T)
Loading ./numbers/bags.lib
Finished loading ./numbers/bags.lib
Loading ./numbers/bags.o
Finished loading ./numbers/bags.o
(#./numbers/bags.lib #./numbers/bags)
(PROVE-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
(PROVE-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
(PROVE-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
(PROVE-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.1 0.1 ]
DIFFERENCE-CANCELLATION
(DISABLE DIFFERENCE-CANCELLATION)
[ 0.0 0.0 0.0 ]
DIFFERENCE-CANCELLATION-OFF
(PROVE-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
(PROVE-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
(PROVE-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, applying COMMUTATIVITY-OF-PLUS, and opening up the
definitions of ZEROP, PLUS, FIX, and EQUAL, 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))),
which simplifies, applying COMMUTATIVITY-OF-PLUS and ADD1-SUB1, and
expanding ZEROP, FIX, IMPLIES, EQUAL, and PLUS, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
PLUS-ZERO-ARG2
(PROVE-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
(PROVE-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 lemmas SUB1-TYPE-RESTRICTION,
PLUS-ADD1-ARG1, COMMUTATIVITY-OF-PLUS, and ADD1-EQUAL, and opening up the
functions EQUAL and PLUS, 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
(PROVE-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
(PROVE-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, rewriting with EQUAL-PLUS-0, and expanding 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)))).
This simplifies, rewriting with COMMUTATIVITY-OF-PLUS, EQUAL-DIFFERENCE-0,
PLUS-ZERO-ARG2, and SUB1-ADD1, and opening up EQUAL, PLUS, DIFFERENCE, ZEROP,
LESSP, and NUMBERP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
PLUS-DIFFERENCE-ARG1
(PROVE-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, applying PLUS-ZERO-ARG2, and unfolding the definitions of
ZEROP, EQUAL, and PLUS, to four new goals:
Case 2.4.
(IMPLIES (AND (EQUAL A 0) (NOT (LESSP C B)))
(EQUAL (DIFFERENCE B C) 0)),
which again simplifies, appealing to the lemma EQUAL-DIFFERENCE-0, to:
T.
Case 2.3.
(IMPLIES (AND (EQUAL A 0)
(LESSP C B)
(NOT (NUMBERP B)))
(EQUAL (DIFFERENCE B C)
(DIFFERENCE 0 C))),
which again simplifies, expanding the definition of LESSP, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (LESSP C B)))
(EQUAL (DIFFERENCE B C) 0)),
which again simplifies, rewriting with the lemma EQUAL-DIFFERENCE-0, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP A))
(LESSP C B)
(NOT (NUMBERP B)))
(EQUAL (DIFFERENCE B C)
(DIFFERENCE 0 C))),
which again simplifies, expanding the function 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 COMMUTATIVITY-OF-PLUS, PLUS-ZERO-ARG2,
EQUAL-DIFFERENCE-0, and SUB1-ADD1, and unfolding ZEROP, PLUS, and DIFFERENCE,
to the following three new conjectures:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(LESSP C B)
(EQUAL (PLUS (SUB1 A) (DIFFERENCE B C))
(DIFFERENCE (PLUS B (SUB1 A)) C))
(NOT (EQUAL C 0))
(NUMBERP C))
(EQUAL (ADD1 (DIFFERENCE (PLUS B (SUB1 A)) C))
(DIFFERENCE (PLUS B (SUB1 A))
(SUB1 C)))).
But this again simplifies, using linear arithmetic, to two new goals:
Case 1.3.2.
(IMPLIES (AND (LESSP (PLUS B (SUB1 A)) C)
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP C B)
(EQUAL (PLUS (SUB1 A) (DIFFERENCE B C))
(DIFFERENCE (PLUS B (SUB1 A)) C))
(NOT (EQUAL C 0))
(NUMBERP C))
(EQUAL (ADD1 (DIFFERENCE (PLUS B (SUB1 A)) C))
(DIFFERENCE (PLUS B (SUB1 A))
(SUB1 C)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.1.
(IMPLIES (AND (LESSP (PLUS B (SUB1 A)) (SUB1 C))
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP C B)
(EQUAL (PLUS (SUB1 A) (DIFFERENCE B C))
(DIFFERENCE (PLUS B (SUB1 A)) C))
(NOT (EQUAL C 0))
(NUMBERP C))
(EQUAL (ADD1 (DIFFERENCE (PLUS B (SUB1 A)) C))
(DIFFERENCE (PLUS B (SUB1 A))
(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 B (SUB1 A)) C))
(EQUAL C 0))
(EQUAL (ADD1 (DIFFERENCE (PLUS B (SUB1 A)) C))
(ADD1 (PLUS B (SUB1 A))))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP (PLUS B (SUB1 A)) 0)
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP 0 B)
(EQUAL (PLUS (SUB1 A) (DIFFERENCE B 0))
(DIFFERENCE (PLUS B (SUB1 A)) 0)))
(EQUAL (ADD1 (DIFFERENCE (PLUS B (SUB1 A)) 0))
(ADD1 (PLUS B (SUB1 A))))).
However 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 B (SUB1 A)) C))
(NOT (NUMBERP C)))
(EQUAL (ADD1 (DIFFERENCE (PLUS B (SUB1 A)) C))
(ADD1 (PLUS B (SUB1 A))))),
which again simplifies, rewriting with COMMUTATIVITY-OF-PLUS and
EQUAL-PLUS-0, and expanding the definitions of LESSP and DIFFERENCE, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
PLUS-DIFFERENCE-ARG2
(PROVE-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)).
But this again simplifies, applying PLUS-ZERO-ARG2 and EQUAL-DIFFERENCE-0,
and expanding ZEROP, to the following two new formulas:
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP Y))
(NOT (NUMBERP X)))
(NOT (LESSP X 0))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP Y)) (NUMBERP X))
(NOT (LESSP X X))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (NUMBERP Y)
(EQUAL (DIFFERENCE (PLUS X Y) X) Y)),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP (PLUS X Y) X) (NUMBERP Y))
(EQUAL (DIFFERENCE (PLUS X Y) X) Y)).
But this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-PLUS-CANCELLATION-PROOF
(PROVE-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 PLUS-ZERO-ARG2, EQUAL-DIFFERENCE-0,
and COMMUTATIVITY-OF-PLUS, and expanding the definitions of FIX, ZEROP, and
AND, to the following two new conjectures:
Case 2. (IMPLIES (AND (NOT (NUMBERP Y))
(EQUAL (DIFFERENCE (PLUS X Y) X) 0)
(NOT (NUMBERP X)))
(NOT (LESSP X 0))).
This again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (NUMBERP Y))
(EQUAL (DIFFERENCE (PLUS X Y) X) 0)
(NUMBERP X))
(NOT (LESSP X X))),
which again simplifies, using linear arithmetic, 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
(PROVE-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, rewriting with PLUS-ZERO-ARG2, and opening up
the functions PLUS, ZEROP, NUMBERP, DIFFERENCE, and EQUAL, to:
T.
Case 2.1.
(IMPLIES (AND (LESSP Y Z) (ZEROP X))
(EQUAL (DIFFERENCE (PLUS X Y) (PLUS X Z))
(DIFFERENCE Y Z))).
But this again simplifies, expanding the functions ZEROP, EQUAL, and PLUS,
to six new conjectures:
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, expanding the definition of 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, expanding the definition of 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 the definitions of 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, unfolding 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, opening up the functions 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 goals:
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, rewriting with SUB1-ADD1, and expanding the
functions 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 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.1 0.0 ]
DIFFERENCE-PLUS-PLUS-CANCELLATION-PROOF
(PROVE-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
(PROVE-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
(PROVE-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
(PROVE-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, applying the lemma PLUS-ZERO-ARG2, and opening up
PLUS, ZEROP, EQUAL, DIFFERENCE, and NUMBERP, 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 formulas:
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 DIFFERENCE, ZEROP, EQUAL, and PLUS, to
two new conjectures:
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, unfolding 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, opening up the functions ZEROP, EQUAL, DIFFERENCE,
and PLUS, to two new conjectures:
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, unfolding the definition of 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, applying the lemma PLUS-ZERO-ARG2, and expanding
the definitions of PLUS, ZEROP, EQUAL, DIFFERENCE, and NUMBERP, 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 goals:
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, applying the lemma SUB1-ADD1, and opening up the
functions 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)))),
which again simplifies, appealing to the lemma SUB1-ADD1, and expanding
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, rewriting with SUB1-ADD1, and opening up the
definitions of PLUS, ZEROP, and DIFFERENCE, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
DIFF-DIFF-ARG1
(PROVE-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, applying EQUAL-DIFFERENCE-0, to:
T.
Case 3.3.
(IMPLIES (AND (EQUAL A 0)
(NOT (LESSP B C))
(NOT (NUMBERP C)))
(EQUAL 0 (DIFFERENCE 0 B))).
This again simplifies, unfolding the definitions of 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 again simplifies, rewriting with EQUAL-DIFFERENCE-0, to:
T.
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, applying EQUAL-PLUS-0, and opening up the definitions of
ZEROP, EQUAL, DIFFERENCE, LESSP, and FIX, to the following four new
conjectures:
Case 2.4.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL B 0)
(NOT (NUMBERP C)))
(EQUAL A (PLUS A C))).
This again simplifies, rewriting with PLUS-ZERO-ARG2, and unfolding the
function ZEROP, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL B 0)
(EQUAL C 0))
(EQUAL A (PLUS A C))).
But 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 A (PLUS A C))),
which again simplifies, applying PLUS-ZERO-ARG2, and unfolding the
function ZEROP, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP B))
(EQUAL C 0))
(EQUAL A (PLUS A C))).
But 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, rewriting with the lemmas COMMUTATIVITY-OF-PLUS,
DIFF-SUB1-ARG2, and SUB1-ADD1, and expanding the functions FIX, PLUS, and
DIFFERENCE, to seven new conjectures:
Case 1.7.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (SUB1 B) C))
(LESSP (PLUS C (SUB1 A)) 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 formulas:
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 C (SUB1 A)) 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 C (SUB1 A)) B)
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
0)
(NOT (LESSP B C)))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
0)).
However this again simplifies, appealing to the lemma EQUAL-DIFFERENCE-0,
to:
(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 C (SUB1 A)) B)
(NOT (LESSP (DIFFERENCE (SUB1 B) C)
(SUB1 A)))
(NOT (LESSP B C)))
(NOT (LESSP (DIFFERENCE B C) A))).
However this again 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 C (SUB1 A)) B)
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
0)
(NOT (LESSP B C)))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
0)),
which again simplifies, applying EQUAL-DIFFERENCE-0, to:
(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 C (SUB1 A)) B)
(NOT (LESSP (DIFFERENCE (SUB1 B) C)
(SUB1 A)))
(NOT (LESSP B C)))
(NOT (LESSP (DIFFERENCE B C) A))),
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 C (SUB1 A)) 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 C (SUB1 A)) B))
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
(ADD1 (DIFFERENCE (PLUS C (SUB1 A)) B)))
(NOT (LESSP B C)))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
(ADD1 (DIFFERENCE (PLUS C (SUB1 A)) B)))),
which again simplifies, using linear arithmetic, to the formula:
(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 C (SUB1 A)) B))
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
(ADD1 (DIFFERENCE (PLUS C (SUB1 A)) B)))
(NOT (LESSP B C)))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
(ADD1 (DIFFERENCE (PLUS C (SUB1 A)) B)))).
However 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 C (SUB1 A)) B))
(EQUAL (DIFFERENCE (SUB1 A)
(DIFFERENCE (SUB1 B) C))
(ADD1 (DIFFERENCE (PLUS C (SUB1 A)) 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 C (SUB1 A)) 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 C (SUB1 A)) B)))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
(ADD1 (DIFFERENCE (PLUS C (SUB1 A)) 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 C (SUB1 A)) B)))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
(ADD1 (DIFFERENCE (PLUS C (SUB1 A)) B)))).
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)
(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 rely upon the type restriction lemma noted when SUB1 was introduced to
restrict the new variable. We thus obtain:
(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 LESSP, DIFFERENCE, and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.1 0.3 ]
DIFF-DIFF-ARG2
(PROVE-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
(PROVE-LEMMA DIFFERENCE-LESSP-ARG1
(REWRITE)
(IMPLIES (LESSP A B)
(EQUAL (DIFFERENCE A B) 0)))
This conjecture can be simplified, using the abbreviations EQUAL-DIFFERENCE-0
and IMPLIES, to:
(IMPLIES (LESSP A B)
(NOT (LESSP B A))).
This simplifies, using linear arithmetic, to:
T.
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
(PROVE-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
(PROVE-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.0 0.0 ]
NUMBERP-EVAL$-PLUS-TREE
(DISABLE NUMBERP-EVAL$-PLUS-TREE)
[ 0.0 0.0 0.0 ]
NUMBERP-EVAL$-PLUS-TREE-OFF
(PROVE-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, rewriting with MEMBER-NON-LIST, and opening up the
definition of NLISTP, 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)))).
This simplifies, unfolding the functions NLISTP, MEMBER, and PLUS-TREE, to
the following three new conjectures:
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)))).
But this again simplifies, applying REWRITE-EVAL$ and CAR-CONS, and
unfolding FIX, to the following two new formulas:
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)))).
But this again simplifies, expanding 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, applying the lemmas REWRITE-EVAL$, CAR-CONS, and
CDR-CONS, to:
(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)))).
But this 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, rewriting with the lemmas 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)))).
However this 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, opening up 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, unfolding NLISTP, MEMBER, and PLUS-TREE, to three new
conjectures:
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, rewriting with REWRITE-EVAL$ and CAR-CONS, and
expanding the definition of FIX, to the following 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)))).
This again simplifies, expanding the definitions of 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)))).
But this further simplifies, expanding 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, applying MEMBER-NON-LIST, and unfolding the
definitions of PLUS-TREE, CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$, and
LESSP, 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)))).
However this 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))
(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, appealing to the lemmas 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))
(NOT (LISTP (CDDR Y))))
(NOT (LESSP (PLUS (EVAL$ T (CAR Y) A)
(EVAL$ T (CADR Y) A))
(EVAL$ T X A)))).
However this further simplifies, applying REWRITE-EVAL$, CAR-CONS,
MEMBER-NON-LIST, and COMMUTATIVITY-OF-PLUS, and unfolding the functions
PLUS-TREE, FIX, and MEMBER, to the following two new goals:
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)))
(EQUAL X (CADR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y))))
(NOT (LESSP (PLUS (EVAL$ T X A)
(EVAL$ T (CAR Y) A))
(EVAL$ T X A)))).
However this 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)))
(EQUAL X (CADR Y))
(LISTP (CDR Y))
(NOT (LISTP (CDDR Y))))
(NOT (LESSP (PLUS (EVAL$ T X A)
(EVAL$ T (CAR 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 0.1 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
(PROVE-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, appealing to the lemma MEMBER-NON-LIST, and unfolding the
definition of NLISTP, 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, unfolding the definitions of NLISTP, MEMBER, DELETE, and
PLUS-TREE, to three new goals:
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 unfolding FIX, to two new goals:
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, unfolding EQUAL and DIFFERENCE, to the goal:
(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, unfolding 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, applying EQUAL-DIFFERENCE-0, and opening up
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, appealing to the lemmas 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)))),
which again simplifies, rewriting with REWRITE-EVAL$, CAR-CONS, CDR-CONS,
and DIFFERENCE-PLUS-CANCELLATION, to the following two new conjectures:
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)).
But this further simplifies, appealing to the lemmas REWRITE-EVAL$ and
CAR-CONS, and unfolding 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))),
which further simplifies, rewriting with the lemmas 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)))),
which simplifies, expanding the functions 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)))),
which simplifies, rewriting with CAR-CONS, LISTP-DELETE, and CDR-CONS, and
expanding NLISTP, MEMBER, DELETE, and PLUS-TREE, to the following six new
goals:
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)))).
This again simplifies, rewriting with LISTP-DELETE, EQUAL-DIFFERENCE-0,
REWRITE-EVAL$, and CAR-CONS, and unfolding the definitions of PLUS-TREE,
CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$, and FIX, to the following two new
formulas:
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)))).
But this again simplifies, using linear arithmetic and rewriting with
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to the following three new
conjectures:
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)))).
This again simplifies, using linear arithmetic and applying the lemma
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)))).
But this 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)))).
However 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)))).
But this again simplifies, opening up the functions 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 applying the lemma
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to three new formulas:
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 rewriting with the
lemma MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, to:
(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)))).
But this again simplifies, using linear arithmetic and appealing to
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, appealing to the lemma NUMBERP-EVAL$-PLUS-TREE,
and opening up 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, obviously, 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 (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, applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, and opening up the functions
EVAL$, EQUAL, LITATOM, LISTP, CAR, CDR, and PLUS-TREE, to the new goal:
(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, applying
MEMBER-IMPLIES-PLUS-TREE-GREATEREQP, and opening up 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)))).
But this again simplifies, rewriting with 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))
(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 goals:
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 applying 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:
(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)))).
But this again simplifies, using linear arithmetic and applying
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)))).
However this again simplifies, applying LISTP-DELETE, REWRITE-EVAL$,
CAR-CONS, CDR-CONS, and PLUS-ZERO-ARG2, and expanding the functions
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 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 goals:
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 applying
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)))).
But 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)))
(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, MEMBER-NON-LIST, REWRITE-EVAL$, and CAR-CONS, and
unfolding the functions DELETE, PLUS-TREE, FIX, and MEMBER, 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,
DELETE-NON-MEMBER, and MEMBER-NON-LIST, and expanding the definition
of 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, DELETE-NON-MEMBER, and MEMBER-NON-LIST, and opening up
the definitions of PLUS-TREE, FIX, 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,
DELETE-NON-MEMBER, and MEMBER-NON-LIST, and opening up the function
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,
MEMBER-NON-LIST, REWRITE-EVAL$, and CAR-CONS, and expanding the
functions DELETE, PLUS-TREE, FIX, EQUAL, and MEMBER, 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 MEMBER-NON-LIST, and opening up
the definitions of PLUS-TREE, FIX, DELETE, LESSP, and MEMBER, 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,
MEMBER-NON-LIST, REWRITE-EVAL$, and CAR-CONS, and unfolding the
functions DELETE, PLUS-TREE, FIX, and MEMBER, 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, applying the lemmas EQUAL-DIFFERENCE-0,
REWRITE-EVAL$, CAR-CONS, CDR-CONS, and DIFFERENCE-PLUS-CANCELLATION, and
unfolding the functions 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 0.7 0.1 ]
PLUS-TREE-DELETE
(DISABLE PLUS-TREE-DELETE)
[ 0.0 0.0 0.0 ]
PLUS-TREE-DELETE-OFF
(PROVE-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 0.1 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
(PROVE-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 BAGDIFF-DELETE,
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 BAGDIFF-DELETE,
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 BAGDIFF-DELETE,
MEMBER-BAGDIFF, PLUS-TREE-DELETE, REWRITE-EVAL$, CAR-CONS,
DELETE-NON-MEMBER, 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)))
(NOT (LESSP (OCCURRENCES (CAR X) (CDR X))
(OCCURRENCES (CAR X) Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF 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 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)))
(NOT (LESSP (OCCURRENCES (CAR X) (CDR X))
(OCCURRENCES (CAR X) Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF 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 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)))
(NOT (LESSP (OCCURRENCES (CAR X) (CDR X))
(OCCURRENCES (CAR X) Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF 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 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 Y (CDR X)))
A)))
(LISTP X)
(MEMBER (CAR X) Y)
(NOT (NUMBERP (EVAL$ T (CADR X) A)))
(NOT (LESSP (OCCURRENCES (CAR X) (CDR X))
(OCCURRENCES (CAR X) Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF 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 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)))
(NOT (LESSP (OCCURRENCES (CAR X) (CDR X))
(OCCURRENCES (CAR X) Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF 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 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)))
(NOT (LESSP (OCCURRENCES (CAR X) (CDR X))
(OCCURRENCES (CAR X) Y)))
(EQUAL (EVAL$ T
(PLUS-TREE (BAGDIFF 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 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 0.6 0.0 ]
PLUS-TREE-BAGDIFF
(DISABLE PLUS-TREE-BAGDIFF)
[ 0.0 0.0 0.0 ]
PLUS-TREE-BAGDIFF-OFF
(PROVE-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 lemma NUMBERP-EVAL$-PLUS-TREE, and opening up
NLISTP, EVAL$, and EQUAL, 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 lemma NUMBERP-EVAL$-PLUS-TREE, and expanding
the definitions of NLISTP, EVAL$, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
NUMBERP-EVAL$-BRIDGE
(DISABLE NUMBERP-EVAL$-BRIDGE)
[ 0.0 0.0 0.0 ]
NUMBERP-EVAL$-BRIDGE-OFF
(PROVE-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.0 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
(PROVE-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 0.3 0.1 ]
EVAL$-PLUS-TREE-APPEND
(DISABLE EVAL$-PLUS-TREE-APPEND)
[ 0.0 0.0 0.0 ]
EVAL$-PLUS-TREE-APPEND-OFF
(PROVE-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,
PLUS-FRINGE, PLUS-TREE, LISTP, 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 PLUS-FRINGE, PLUS-TREE, CAR, LISTP, 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, PLUS-FRINGE, PLUS-TREE,
LISTP, 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 PLUS-FRINGE, PLUS-TREE, CAR, LISTP, 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 0.1 0.1 ]
PLUS-TREE-PLUS-FRINGE
(DISABLE PLUS-TREE-PLUS-FRINGE)
[ 0.0 0.0 0.0 ]
PLUS-TREE-PLUS-FRINGE-OFF
(PROVE-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 MEMBER-NON-LIST, CDR-CONS, and CAR-CONS,
and opening up the definitions of AND, PLUS-FRINGE, MEMBER, EQUAL, and EVAL$,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
MEMBER-IMPLIES-NUMBERP
(DISABLE MEMBER-IMPLIES-NUMBERP)
[ 0.0 0.0 0.0 ]
MEMBER-IMPLIES-NUMBERP-OFF
(PROVE-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
(PROVE-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
(PROVE-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
(PROVE-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.5 0.4 ]
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.0 0.0 0.0 ]
CANCEL-DIFFERENCE-PLUS
(PROVE-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.5 0.1 ]
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS
(PROVE-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
(PROVE-LEMMA DIFFERENCE-LEQ-ARG1
(REWRITE)
(IMPLIES (LEQ A B)
(EQUAL (DIFFERENCE A B) 0)))
This conjecture can be simplified, using the abbreviations EQUAL-DIFFERENCE-0
and IMPLIES, to:
T.
This simplifies, trivially, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-LEQ-ARG1
(PROVE-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
(PROVE-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
(PROVE-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
(PROVE-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
(PROVE-LEMMA DIFFERENCE-X-X
(REWRITE)
(EQUAL (DIFFERENCE X X) 0))
This conjecture can be simplified, using the abbreviations NOT and
EQUAL-DIFFERENCE-0, to:
(NOT (LESSP X X)).
This simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-X-X
(PROVE-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))).
Applying the lemma DIFFERENCE-ELIM, replace A by (PLUS C X) to eliminate
(DIFFERENCE A C). 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 2.2.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (LESSP A C)))
(EQUAL (LESSP (DIFFERENCE A C)
(DIFFERENCE B C))
(LESSP A B))).
But this further simplifies, using linear arithmetic, applying
DIFFERENCE-LEQ-ARG1, and expanding the functions LESSP, EQUAL, and
DIFFERENCE, to the following four new conjectures:
Case 2.2.4.
(IMPLIES (AND (NOT (NUMBERP A))
(EQUAL C 0)
(NOT (EQUAL B 0))
(NOT (NUMBERP B)))
(EQUAL F (NUMBERP B))).
This again simplifies, clearly, to:
T.
Case 2.2.3.
(IMPLIES (AND (NOT (NUMBERP A))
(EQUAL C 0)
(NOT (EQUAL B 0))
(NUMBERP B))
(EQUAL T (NUMBERP B))).
This again simplifies, trivially, to:
T.
Case 2.2.2.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (NUMBERP C))
(NOT (EQUAL B 0))
(NOT (NUMBERP B)))
(EQUAL F (NUMBERP B))).
This again simplifies, clearly, to:
T.
Case 2.2.1.
(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 2.1.
(IMPLIES (AND (NUMBERP X)
(NOT (LESSP (PLUS C X) C)))
(EQUAL (LESSP X (DIFFERENCE B C))
(LESSP (PLUS C X) B))).
Appealing to the lemma DIFFERENCE-ELIM, we now replace B by (PLUS C Z) to
eliminate (DIFFERENCE B C). We use the type restriction lemma noted when
DIFFERENCE was introduced to constrain the new variable. We must thus
prove three new conjectures:
Case 2.1.3.
(IMPLIES (AND (LESSP B C)
(NUMBERP X)
(NOT (LESSP (PLUS C X) C)))
(EQUAL (LESSP X (DIFFERENCE B C))
(LESSP (PLUS C X) B))),
which further simplifies, using linear arithmetic, rewriting with
DIFFERENCE-LEQ-ARG1, and unfolding EQUAL and LESSP, to:
(IMPLIES (AND (LESSP B C)
(NUMBERP X)
(NOT (LESSP (PLUS C X) C)))
(NOT (LESSP (PLUS C X) B))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.2.
(IMPLIES (AND (NOT (NUMBERP B))
(NUMBERP X)
(NOT (LESSP (PLUS C X) C)))
(EQUAL (LESSP X (DIFFERENCE B C))
(LESSP (PLUS C X) B))),
which further simplifies, using linear arithmetic, rewriting with
DIFFERENCE-LEQ-ARG1, and expanding EQUAL and LESSP, to:
T.
Case 2.1.1.
(IMPLIES (AND (NUMBERP Z)
(NOT (LESSP (PLUS C Z) C))
(NUMBERP X)
(NOT (LESSP (PLUS C X) C)))
(EQUAL (LESSP X Z)
(LESSP (PLUS C X) (PLUS C 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 (LESSP (DIFFERENCE A C)
(DIFFERENCE B C))
(IF (IF (LESSP A C) F T)
(LESSP A B)
(LESSP C B))).
We gave this the name *1 above. Perhaps we can prove it by induction. The
recursive terms in the conjecture suggest ten inductions. 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 goals:
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, using linear arithmetic, applying DIFFERENCE-LEQ-ARG1, and
opening up the functions ZEROP, DIFFERENCE, EQUAL, and LESSP, to the
following 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))).
This again simplifies, obviously, 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, obviously, 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, obviously, 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)))).
But this again simplifies, rewriting with 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)))).
However 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, trivially, 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, rewriting with 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)))).
This again simplifies, rewriting with 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, expanding 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)))).
But 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, unfolding the definitions of 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 functions 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, expanding 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 ZEROP, DIFFERENCE, and LESSP, to four new
formulas:
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 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, applying the lemma DIFFERENCE-SUB1-ARG2, and
unfolding the definitions of SUB1, EQUAL, 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, opening up the definitions of 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, applying the lemma DIFFERENCE-SUB1-ARG2, and
expanding SUB1, EQUAL, and LESSP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
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
(PROVE-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.5 0.0 ]
CORRECTNESS-OF-CANCEL-LESSP-PLUS
(PROVE-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 PLUS-ZERO-ARG2, and
expanding the functions ZEROP, OR, TIMES, EQUAL, and PLUS, 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
(PROVE-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, applying PLUS-ZERO-ARG2 and EQUAL-TIMES-0, and unfolding
the definitions of AND, TIMES, ZEROP, SUB1, NUMBERP, and EQUAL, to the
following eight new goals:
Case 1.8.
(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)).
This again simplifies, obviously, to the new conjecture:
(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)).
However this again simplifies, rewriting with PLUS-ZERO-ARG2 and
EQUAL-TIMES-0, and unfolding the definitions of ZEROP, TIMES, and EQUAL,
to:
T.
Case 1.7.
(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))).
However this again simplifies, expanding the functions EQUAL, NUMBERP,
SUB1, TIMES, and PLUS, to:
T.
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 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 thus obtain the new formula:
(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, applying 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)),
which we will name *1.
Case 1.5.
(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))).
But this again simplifies, using linear arithmetic, to the conjecture:
(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))).
However this again simplifies, applying the lemmas PLUS-ZERO-ARG2 and
EQUAL-TIMES-0, and expanding ZEROP, TIMES, and EQUAL, to:
T.
Case 1.4.
(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))
(NUMBERP B))
(NOT (EQUAL (PLUS B B) 1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(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 (NUMBERP B)))
(NOT (EQUAL (PLUS B 0) 1))),
which again simplifies, rewriting with PLUS-ZERO-ARG2 and EQUAL-TIMES-0,
and opening up the definitions of ZEROP, SUB1, NUMBERP, EQUAL, and TIMES,
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)
(EQUAL A 1)
(NUMBERP B))
(EQUAL (EQUAL (PLUS B B) 1) T)).
However this 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)
(NOT (NUMBERP B)))
(EQUAL (EQUAL (PLUS B 0) 1) T)),
which again simplifies, using linear arithmetic, to:
T.
So we now return 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)),
which is formula *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 can be
used to prove 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 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)).
This simplifies, expanding the definition of 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)).
This simplifies, applying PLUS-ZERO-ARG2, PLUS-ADD1-ARG2, ADD1-EQUAL, and
EQUAL-PLUS-0, and expanding ZEROP, TIMES, and NUMBERP, 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 the conjecture:
(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, opening up 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
(PROVE-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
(PROVE-LEMMA TIMES-ZERO
(REWRITE)
(IMPLIES (ZEROP Y)
(EQUAL (TIMES X Y) 0))
((ENABLE PLUS-ZERO-ARG2 COMMUTATIVITY-OF-PLUS)))
This formula can be simplified, using the abbreviations EQUAL-TIMES-0 and
IMPLIES, to:
(IMPLIES (AND (ZEROP Y)
(NOT (EQUAL X 0))
(NUMBERP X)
(NOT (EQUAL Y 0)))
(NOT (NUMBERP Y))),
which simplifies, opening up the function ZEROP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-ZERO
(PROVE-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 PLUS-ADD1-ARG1, and
unfolding the functions ZEROP, FIX, and TIMES, 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,
PLUS-ADD1-ARG1, and ADD1-SUB1, and unfolding PLUS, EQUAL, and TIMES, 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)))).
However this again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-ADD1
(PROVE-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.1 0.0 ]
COMMUTATIVITY-OF-TIMES
(PROVE-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.1 0.0 ]
TIMES-DISTRIBUTES-OVER-PLUS-PROOF
(PROVE-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.1 0.0 ]
TIMES-DISTRIBUTES-OVER-PLUS
(PROVE-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.1 0.0 ]
COMMUTATIVITY2-OF-TIMES
(PROVE-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
(PROVE-LEMMA TIMES-DISTRIBUTES-OVER-DIFFERENCE-PROOF NIL
(EQUAL (TIMES (DIFFERENCE A B) C)
(DIFFERENCE (TIMES A C) (TIMES B C)))
((ENABLE COMMUTATIVITY-OF-TIMES)))
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 lemmas EQUAL-PLUS-0, EQUAL-TIMES-0, and
EQUAL-SUB1-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 (PLUS C (TIMES (SUB1 A) C))
0)).
But this again simplifies, applying EQUAL-SUB1-0, EQUAL-TIMES-0, and
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 (PLUS C (TIMES (SUB1 A) C))
0)).
This again simplifies, rewriting with COMMUTATIVITY-OF-TIMES, and
expanding EQUAL, TIMES, and PLUS, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP B))
(NOT (NUMBERP C)))
(EQUAL (PLUS C (TIMES (SUB1 A) C))
0)).
This again simplifies, rewriting with EQUAL-SUB1-0, EQUAL-TIMES-0, and
PLUS-ZERO-ARG2, and unfolding ZEROP and EQUAL, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (NUMBERP B))
(EQUAL C 0))
(EQUAL (PLUS C (TIMES (SUB1 A) C))
0)).
But this again simplifies, applying the lemma COMMUTATIVITY-OF-TIMES, and
unfolding the functions EQUAL, TIMES, and PLUS, 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, rewriting with COMMUTATIVITY-OF-TIMES and
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and expanding the functions 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
(PROVE-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.4 0.0 ]
TIMES-DISTRIBUTES-OVER-DIFFERENCE
(PROVE-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 lemmas COMMUTATIVITY-OF-TIMES,
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, PLUS-ZERO-ARG2, PLUS-DIFFERENCE-ARG2,
and TIMES-ADD1, and unfolding the functions ZEROP, NOT, AND, FIX, IMPLIES,
REMAINDER, and QUOTIENT, to the following two new conjectures:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (LESSP Y X))
(EQUAL (TIMES X
(QUOTIENT (DIFFERENCE Y X) X))
(DIFFERENCE Y X))
(EQUAL (REMAINDER (DIFFERENCE Y X) X)
0)
(NOT (LESSP X Y)))
(EQUAL X Y)).
However this again simplifies, using linear arithmetic, to the formula:
(IMPLIES (AND (NOT (NUMBERP Y))
(NOT (EQUAL X 0))
(NUMBERP X)
(NOT (LESSP Y X))
(EQUAL (TIMES X
(QUOTIENT (DIFFERENCE Y X) X))
(DIFFERENCE Y X))
(EQUAL (REMAINDER (DIFFERENCE Y X) X)
0)
(NOT (LESSP X Y)))
(EQUAL X Y)).
This again simplifies, expanding the definition of LESSP, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(NOT (LESSP Y X))
(EQUAL (TIMES X
(QUOTIENT (DIFFERENCE Y X) X))
(DIFFERENCE Y X))
(EQUAL (REMAINDER (DIFFERENCE Y X) X)
0)
(NOT (NUMBERP Y)))
(LESSP X Y)),
which again simplifies, opening up the definition of LESSP, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
TIMES-QUOTIENT-PROOF
(PROVE-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
(PROVE-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, rewriting with PLUS-ZERO-ARG2 and EQUAL-TIMES-0, and
unfolding ZEROP, SUB1, NUMBERP, EQUAL, TIMES, and FIX, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-1-ARG1
(PROVE-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, applying EQUAL-PLUS-0, and unfolding NOT, OR, EQUAL, LESSP,
and TIMES, 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))).
This 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))),
which again simplifies, opening up 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, opening up 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
(PROVE-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
(PROVE-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
(PROVE-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
(PROVE-LEMMA LESSP-TIMES3-PROOF1 NIL
(IMPLIES (AND (NOT (ZEROP A)) (LESSP 1 B))
(LESSP A (TIMES A B)))
((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-SUB1-0, EQUAL-TIMES-0, and EQUAL-PLUS-0, and
opening up the definitions of TIMES, EQUAL, 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-SUB1-0, EQUAL-TIMES-0, and
EQUAL-PLUS-0, and expanding the functions TIMES, EQUAL, 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-TIMES-0, PLUS-ZERO-ARG2, EQUAL-SUB1-0, and
TIMES-1-ARG1, and unfolding the definitions of TIMES, ZEROP, EQUAL, NOT, OR,
and NUMBERP, 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, rewriting with the lemmas EQUAL-SUB1-0, EQUAL-TIMES-0, and
EQUAL-PLUS-0, and opening up the functions TIMES, EQUAL, NOT, and OR, to the
goal:
(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)))).
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-TIMES3-PROOF1
(PROVE-LEMMA LESSP-TIMES3-PROOF2 NIL
(IMPLIES (LESSP A (TIMES A B))
(AND (NOT (ZEROP A)) (LESSP 1 B))))
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
(PROVE-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.1 0.0 ]
LESSP-TIMES3
(PROVE-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, using linear arithmetic, applying the lemma
LESSP-TIMES2, and expanding 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, rewriting with EQUAL-SUB1-0, EQUAL-TIMES-0, and
LESSP-TIMES2, and expanding LESSP and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
LESSP-TIMES-CANCELLATION-PROOF
(PROVE-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 TIMES-ZERO and
COMMUTATIVITY-OF-TIMES, and opening up the definitions of ZEROP, NOT, AND,
LESSP, EQUAL, and TIMES, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
LESSP-TIMES-CANCELLATION1
(DISABLE LESSP-TIMES-CANCELLATION1)
[ 0.0 0.0 0.0 ]
LESSP-TIMES-CANCELLATION1-OFF
(PROVE-LEMMA LESSP-PLUS-TIMES-PROOF NIL
(IMPLIES (LESSP X A)
(EQUAL (LESSP (PLUS X (TIMES A B))
(TIMES A C))
(LESSP B C)))
((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.2 0.3 ]
LESSP-PLUS-TIMES-PROOF
(PROVE-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,
COMMUTATIVITY-OF-PLUS, and PLUS-ZERO-ARG2, and unfolding IMPLIES, ZEROP, AND,
TIMES, LESSP, EQUAL, and PLUS, 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, rewriting with TIMES-ZERO and PLUS-ZERO-ARG2, and
opening up the functions ZEROP, 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)).
This again simplifies, rewriting with the lemmas COMMUTATIVITY-OF-TIMES and
PLUS-ZERO-ARG2, and opening up the functions EQUAL, TIMES, ZEROP, and LESSP,
to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
LESSP-PLUS-TIMES1
(PROVE-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.1 0.0 ]
LESSP-PLUS-TIMES2
(PROVE-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, appealing to the lemma COMMUTATIVITY-OF-TIMES, and
unfolding the definitions of EQUAL, TIMES, and LESSP, to:
T.
Case 6. (IMPLIES (NOT (NUMBERP B))
(EQUAL (LESSP 1 (TIMES A B)) F)),
which again simplifies, rewriting with TIMES-ZERO, and opening up ZEROP,
LESSP, and EQUAL, to:
T.
Case 5. (IMPLIES (AND (EQUAL A 1) (EQUAL B 1))
(EQUAL (LESSP 1 (TIMES A B)) F)).
But this again simplifies, unfolding the functions TIMES, LESSP, and EQUAL,
to:
T.
Case 4. (IMPLIES (NOT (NUMBERP A))
(EQUAL (LESSP 1 (TIMES A B)) F)),
which again simplifies, unfolding the definitions of TIMES, LESSP, and EQUAL,
to:
T.
Case 3. (IMPLIES (EQUAL A 0)
(EQUAL (LESSP 1 (TIMES A B)) F)),
which again simplifies, expanding the functions EQUAL, TIMES, and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL A 1)))
(EQUAL (LESSP 1 (TIMES A B)) T)),
which again simplifies, using linear arithmetic, applying LESSP-TIMES1, and
opening up the definition of EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL B 1)))
(EQUAL (LESSP 1 (TIMES A B)) T)).
But this again simplifies, using linear arithmetic, rewriting with
LESSP-TIMES1, and unfolding the definition of EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
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
(PROVE-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
(PROVE-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, CAR-NLISTP, and
COMMUTATIVITY-OF-TIMES, and expanding the definitions of LISTP, LITATOM,
EQUAL, EVAL$, and TIMES, 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, CDR-CONS,
and COMMUTATIVITY-OF-TIMES, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EVAL$-TIMES
(DISABLE EVAL$-TIMES)
[ 0.0 0.0 0.0 ]
EVAL$-TIMES-OFF
(PROVE-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.0 0.0 ]
EVAL$-OR
(DISABLE EVAL$-OR)
[ 0.0 0.0 0.0 ]
EVAL$-OR-OFF
(PROVE-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.0 0.0 ]
EVAL$-EQUAL
(DISABLE EVAL$-EQUAL)
[ 0.0 0.0 0.0 ]
EVAL$-EQUAL-OFF
(PROVE-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.0 0.0 ]
EVAL$-LESSP
(DISABLE EVAL$-LESSP)
[ 0.0 0.0 0.0 ]
EVAL$-LESSP-OFF
(PROVE-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.0 0.0 ]
EVAL$-QUOTIENT
(DISABLE EVAL$-QUOTIENT)
[ 0.0 0.0 0.0 ]
EVAL$-QUOTIENT-OFF
(PROVE-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.0 0.0 ]
EVAL$-IF
(DISABLE EVAL$-IF)
[ 0.0 0.0 0.0 ]
EVAL$-IF-OFF
(PROVE-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.0 0.0 ]
NUMBERP-EVAL$-TIMES-TREE
(DISABLE NUMBERP-EVAL$-TIMES-TREE)
[ 0.0 0.0 0.0 ]
NUMBERP-EVAL$-TIMES-TREE-OFF
(PROVE-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 lemmas EQUAL-SUB1-0, COMMUTATIVITY-OF-TIMES,
and TIMES-1-ARG1, and opening up the definitions of ZEROP, NOT, IMPLIES, and
TIMES, to eight new formulas:
Case 1.8.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(LESSP X Y)
(LESSP (TIMES X (SUB1 A))
(TIMES Y (SUB1 A))))
(LESSP (PLUS X (TIMES X (SUB1 A)))
(PLUS Y (TIMES Y (SUB1 A))))),
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 X (SUB1 A))
(TIMES Y (SUB1 A)))))
(NOT (LESSP (PLUS X (TIMES X (SUB1 A)))
(PLUS Y (TIMES Y (SUB1 A)))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL A 1)
(NOT (LESSP X Y))
(NUMBERP Y)
(NOT (NUMBERP X)))
(NOT (LESSP 0 Y))),
which again simplifies, expanding EQUAL, NUMBERP, and LESSP, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL A 1)
(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 A 1)
(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 A 1)
(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 A 1)
(LESSP X Y)
(NOT (NUMBERP Y))
(NUMBERP X))
(LESSP X 0)),
which again simplifies, expanding the functions EQUAL, NUMBERP, and LESSP,
to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL A 1)
(LESSP X Y)
(NOT (NUMBERP Y))
(NOT (NUMBERP X)))
(LESSP 0 0)),
which again simplifies, opening up the functions EQUAL, NUMBERP, and LESSP,
to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
LESSP-TIMES-ARG1
(PROVE-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
(PROVE-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, using linear arithmetic, applying TIMES-ZERO and
LESSP-TIMES2, and expanding LESSP and ZEROP, 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)).
But this again simplifies, unfolding the function 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, applying the lemmas TIMES-ZERO and
COMMUTATIVITY-OF-TIMES, and expanding EQUAL, LESSP, ZEROP, and TIMES, 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, obviously, 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)).
But this again simplifies, applying TIMES-ZERO, and unfolding LESSP and
ZEROP, 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))).
But this 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)).
This again simplifies, unfolding the function 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)).
However this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.4 0.0 ]
EQUAL-TIMES-ARG1
(DISABLE EQUAL-TIMES-ARG1)
[ 0.0 0.0 0.0 ]
EQUAL-TIMES-ARG1-OFF
(PROVE-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.0 0.0 ]
EQUAL-TIMES-BRIDGE
(DISABLE EQUAL-TIMES-BRIDGE)
[ 0.0 0.0 0.0 ]
EQUAL-TIMES-BRIDGE-OFF
(PROVE-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 0.6 0.0 ]
EVAL$-TIMES-MEMBER
(DISABLE EVAL$-TIMES-MEMBER)
[ 0.0 0.0 0.0 ]
EVAL$-TIMES-MEMBER-OFF
(PROVE-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.1 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
(PROVE-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.1 0.0 ]
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
(PROVE-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.0 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
(PROVE-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 EQUAL-TIMES-1,
REWRITE-EVAL$, CAR-CONS, and TIMES-1-ARG1, and expanding the definitions
of TIMES-TREE, CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$, and FIX, 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 expanding the definition of FIX, to the following two new goals:
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))).
This again simplifies, applying 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)))).
This again simplifies, appealing to the lemma COMMUTATIVITY-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)))
(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)))).
This further simplifies, applying NUMBERP-EVAL$-TIMES-TREE, TIMES-1-ARG1,
and COMMUTATIVITY-OF-TIMES, and opening up 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)))).
However this again simplifies, rewriting with REWRITE-EVAL$, CAR-CONS,
CDR-CONS, TIMES-ZERO, NUMBERP-EVAL$-TIMES-TREE, and EQUAL-TIMES-0, and
unfolding TIMES-TREE, FIX, and ZEROP, to the following three new formulas:
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))).
However this again simplifies, applying NUMBERP-EVAL$-TIMES-TREE and
EQUAL-TIMES-0, to the new conjecture:
(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 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, appealing to the lemma COMMUTATIVITY-OF-TIMES,
and expanding 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 the lemma 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)))).
However this further simplifies, rewriting with NUMBERP-EVAL$-TIMES-TREE,
TIMES-1-ARG1, COMMUTATIVITY-OF-TIMES, REWRITE-EVAL$, and CAR-CONS, and
unfolding 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, rewriting with REWRITE-EVAL$ and CAR-CONS, and
unfolding the functions 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)))).
However this again simplifies, applying the lemmas EQUAL-TIMES-1,
REWRITE-EVAL$, CAR-CONS, CDR-CONS, TIMES-1-ARG1, and
COMMUTATIVITY-OF-TIMES, and unfolding the definitions of 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)))),
which again simplifies, rewriting with 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)))).
However this again simplifies, rewriting with the lemmas REWRITE-EVAL$,
CAR-CONS, CDR-CONS, TIMES-ZERO, COMMUTATIVITY-OF-TIMES, and
COMMUTATIVITY2-OF-TIMES, and opening up the definitions of 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)))),
which again simplifies, applying EQUAL-TIMES-1, REWRITE-EVAL$, CAR-CONS,
CDR-CONS, and TIMES-1-ARG1, and expanding the definitions of TIMES-TREE,
CDR, CAR, LISTP, LITATOM, EQUAL, EVAL$, and FIX, to the following two new
formulas:
Case 2.3.2.
(IMPLIES (AND (LISTP X)
(EQUAL 1 (EVAL$ T (TIMES-TREE Y) A))
(EQUAL 1
(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 (CADR X) A)))).
However this again simplifies, opening up TIMES and EQUAL, to:
T.
Case 2.3.1.
(IMPLIES (AND (LISTP X)
(EQUAL 1 (EVAL$ T (TIMES-TREE Y) A))
(EQUAL 1
(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 (CADR X) A)))),
which further simplifies, applying REWRITE-EVAL$, CAR-CONS, TIMES-1-ARG1,
and COMMUTATIVITY-OF-TIMES, and unfolding TIMES-TREE and FIX, 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, appealing to the lemmas 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)))).
But this further simplifies, rewriting with REWRITE-EVAL$, CAR-CONS,
COMMUTATIVITY-OF-TIMES, and TIMES-ZERO, and unfolding 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)))).
However this 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 functions 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)))).
But 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))
(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)))),
which further simplifies, rewriting with REWRITE-EVAL$ and CAR-CONS, and
expanding the functions 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, clearly, 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 the definitions of
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 definitions of APPEND, TIMES-TREE, CDR, CAR, LISTP, LITATOM,
EQUAL, and EVAL$, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.8 0.1 ]
TIMES-TREE-APPEND
(DISABLE TIMES-TREE-APPEND)
[ 0.0 0.0 0.0 ]
TIMES-TREE-APPEND-OFF
(PROVE-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.1 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))
(IF (LISTP (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
(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)))))))
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
(PROVE-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 0.2 0.0 ]
EVAL$-LESSP-TIMES-TREE-BAGDIFF
(DISABLE EVAL$-LESSP-TIMES-TREE-BAGDIFF)
[ 0.0 0.0 0.0 ]
EVAL$-LESSP-TIMES-TREE-BAGDIFF-OFF
(PROVE-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, MEMBER-NON-LIST, 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, BAGINT,
DELETE, MEMBER, LISTP, 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 0.6 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
(PROVE-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 0.2 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))
(IF (LISTP (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
(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)))))))
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
(PROVE-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,
MEMBER-NON-LIST, 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, BAGINT,
DELETE, MEMBER, LISTP, 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 0.8 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
(PROVE-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 0.3 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
(PROVE-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.1 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
(PROVE-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 0.3 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
(PROVE-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 0.3 0.0 ]
CORRECTNESS-OF-CANCEL-EQUAL-TIMES
(PROVE-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
(PROVE-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
(PROVE-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
(PROVE-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
(PROVE-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 REMAINDER-OF-NON-NUMBER and
COMMUTATIVITY-OF-TIMES, and opening up LESSP, EQUAL, NUMBERP, REMAINDER,
QUOTIENT, 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 REMAINDER-ZERO, PLUS-ZERO-ARG2, TIMES-ZERO, and
COMMUTATIVITY-OF-TIMES, and unfolding the functions ZEROP, EQUAL, QUOTIENT,
and TIMES, 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 REMAINDER-NOOP,
COMMUTATIVITY-OF-TIMES, and PLUS-ZERO-ARG2, and opening up the functions
ZEROP, QUOTIENT, EQUAL, and TIMES, 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, COMMUTATIVITY-OF-PLUS,
CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, PLUS-ZERO-ARG2, PLUS-DIFFERENCE-ARG2,
and COMMUTATIVITY2-OF-PLUS, and opening up the functions ZEROP, REMAINDER,
QUOTIENT, and FIX, 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)
(NOT (LESSP Y X)))
(EQUAL Y X)).
But this again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
PLUS-REMAINDER-TIMES-QUOTIENT
(DISABLE PLUS-REMAINDER-TIMES-QUOTIENT)
[ 0.0 0.0 0.0 ]
PLUS-REMAINDER-TIMES-QUOTIENT-OFF
(PROVE-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
(PROVE-LEMMA REMAINDER-ADD1
(REWRITE)
(IMPLIES (EQUAL (REMAINDER A B) 0)
(EQUAL (REMAINDER (ADD1 A) B)
(REMAINDER 1 B)))
((ENABLE REMAINDER-NOOP)
(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 lemmas REMAINDER-ZERO and
SUB1-TYPE-RESTRICTION, and unfolding the functions ZEROP, ADD1, REMAINDER,
EQUAL, 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 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 B V)) to eliminate (REMAINDER X B) and (QUOTIENT X B). 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 constrain the new variables. 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 Z)
(EQUAL (LESSP Z B) (NOT (ZEROP B)))
(NUMBERP V)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (PLUS B Z (TIMES B V)) B))
(LESSP 1 B)
(EQUAL (REMAINDER (ADD1 (PLUS Z (TIMES B V)))
B)
1)
(EQUAL Z 0))
(EQUAL (REMAINDER (ADD1 (PLUS B Z (TIMES B V)))
B)
1)),
which further simplifies, applying LESSP-PLUS-TIMES1,
DIFFERENCE-SUB1-ARG2, CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and
SUB1-ADD1, and opening up NUMBERP, EQUAL, LESSP, ZEROP, NOT, PLUS, FIX,
DIFFERENCE, and REMAINDER, to the following two new conjectures:
Case 1.1.1.2.
(IMPLIES (AND (NUMBERP V)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP B B))
(LESSP 1 B)
(EQUAL (REMAINDER (ADD1 (TIMES B V)) B)
1)
(LESSP (PLUS B (TIMES B V)) (SUB1 B)))
(EQUAL (ADD1 (PLUS B (TIMES B V)))
1)).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.1.1.1.
(IMPLIES (AND (NUMBERP V)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL V 0))
(LESSP 1 B)
(EQUAL (REMAINDER (ADD1 (TIMES B V)) B)
1)
(LESSP (PLUS B (TIMES B V)) (SUB1 B)))
(EQUAL (ADD1 (PLUS B (TIMES B V)))
1)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.6 0.0 ]
REMAINDER-ADD1
(PROVE-LEMMA REMAINDER-PLUS-PROOF NIL
(IMPLIES (EQUAL (REMAINDER B C) 0)
(EQUAL (REMAINDER (PLUS A B) C)
(REMAINDER A C)))
((ENABLE REMAINDER-NOOP)
(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 REMAINDER-ZERO and PLUS-ZERO-ARG2, and opening up
the definition of ZEROP, 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
REMAINDER-OF-NON-NUMBER, 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 REMAINDER-OF-NON-NUMBER, 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
lemmas REMAINDER-NOOP and REMAINDER-OF-NON-NUMBER, and unfolding NUMBERP
and EQUAL, 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.2 0.0 ]
REMAINDER-PLUS-PROOF
(PROVE-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.4 0.0 ]
REMAINDER-PLUS
(PROVE-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
(PROVE-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 REMAINDER-PLUS, COMMUTATIVITY-OF-PLUS, and
COMMUTATIVITY2-OF-PLUS, and expanding EQUAL, IMPLIES, and AND, to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
EQUAL-REMAINDER-PLUS-0
(PROVE-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)
(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, DIFFERENCE-LEQ-ARG1, REMAINDER-NOOP, and
REMAINDER-PLUS, and expanding the functions ZEROP, IMPLIES, REMAINDER, EQUAL,
LESSP, PLUS, and NUMBERP, to the following nine new formulas:
Case 1.9.
(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.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)
(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.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))
(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.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))
(NOT (NUMBERP B)))
(EQUAL (REMAINDER 0 C)
(REMAINDER (DIFFERENCE B C) C))),
which again simplifies, expanding the function LESSP, to:
T.
Case 1.5.
(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.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)),
which again simplifies, expanding 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:
(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)).
This again simplifies, rewriting with REMAINDER-NOOP and DIFFERENCE-X-X,
and unfolding the definitions of 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)).
However this again simplifies, expanding the definition of 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 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)
(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 LESSP, EQUAL, NUMBERP, and REMAINDER, to:
T.
Q.E.D.
[ 0.0 0.6 0.0 ]
EQUAL-REMAINDER-PLUS-REMAINDER-PROOF
(PROVE-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 PLUS-ZERO-ARG2 and 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, using linear arithmetic, rewriting with
PLUS-ZERO-ARG2, REMAINDER-NOOP, and REMAINDER-OF-NON-NUMBER, and expanding
the functions ZEROP, NUMBERP, and EQUAL, 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))).
This again simplifies, using linear arithmetic, applying PLUS-ZERO-ARG2,
REMAINDER-NOOP, and REMAINDER-OF-NON-NUMBER, and expanding ZEROP, NUMBERP,
and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
EQUAL-REMAINDER-PLUS-REMAINDER
(DISABLE EQUAL-REMAINDER-PLUS-REMAINDER)
[ 0.0 0.0 0.0 ]
EQUAL-REMAINDER-PLUS-REMAINDER-OFF
(PROVE-LEMMA REMAINDER-TIMES1-PROOF NIL
(IMPLIES (EQUAL (REMAINDER B C) 0)
(EQUAL (REMAINDER (TIMES A B) C) 0))
((ENABLE REMAINDER-PLUS REMAINDER-NOOP REMAINDER-ZERO)))
.
Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace B by
(PLUS X (TIMES C Z)) to eliminate (REMAINDER B C) and (QUOTIENT B C). 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 four new conjectures:
Case 4. (IMPLIES (AND (NOT (NUMBERP B))
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER (TIMES A B) C) 0)),
which simplifies, rewriting with the lemmas REMAINDER-OF-NON-NUMBER and
TIMES-ZERO, and unfolding the functions LESSP, EQUAL, NUMBERP, REMAINDER,
and ZEROP, to:
T.
Case 3. (IMPLIES (AND (EQUAL C 0)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER (TIMES A B) C) 0)),
which simplifies, applying REMAINDER-ZERO, COMMUTATIVITY-OF-TIMES, and
TIMES-ZERO, and opening up the definitions of ZEROP, EQUAL, TIMES, and
REMAINDER, to:
T.
Case 2. (IMPLIES (AND (NOT (NUMBERP C))
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER (TIMES A B) C) 0)).
This simplifies, applying REMAINDER-ZERO, COMMUTATIVITY-OF-TIMES, and
TIMES-ZERO, and unfolding ZEROP, EQUAL, TIMES, and NUMBERP, to:
T.
Case 1. (IMPLIES (AND (NUMBERP X)
(EQUAL (LESSP X C) (NOT (ZEROP C)))
(NUMBERP Z)
(NUMBERP C)
(NOT (EQUAL C 0))
(EQUAL X 0))
(EQUAL (REMAINDER (TIMES A (PLUS X (TIMES C Z)))
C)
0)).
However this simplifies, unfolding the definitions of NUMBERP, EQUAL, LESSP,
ZEROP, NOT, and PLUS, to the conjecture:
(IMPLIES (AND (NUMBERP Z)
(NUMBERP C)
(NOT (EQUAL C 0)))
(EQUAL (REMAINDER (TIMES A C Z) C)
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 (EQUAL (REMAINDER B C) 0)
(EQUAL (REMAINDER (TIMES A B) C) 0)).
We gave this the name *1 above. Perhaps we can prove it by induction. There
are two plausible inductions. 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 leads to the following two new goals:
Case 2. (IMPLIES (AND (ZEROP A)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER (TIMES A B) C) 0)).
This simplifies, unfolding 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)).
This 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.1 0.0 ]
REMAINDER-TIMES1-PROOF
(PROVE-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.1 0.0 ]
REMAINDER-TIMES1
(PROVE-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, REMAINDER-NOOP,
DIFFERENCE-X-X, and REMAINDER-PLUS, and unfolding TIMES, EQUAL, LESSP,
NUMBERP, and REMAINDER, to the conjecture:
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (REMAINDER (TIMES Y (SUB1 X)) Y)
0)
(NOT (EQUAL Y 0))
(NUMBERP Y))
(NOT (LESSP Y Y))).
This again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
REMAINDER-TIMES1-INSTANCE-PROOF
(PROVE-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.1 0.0 ]
REMAINDER-TIMES1-INSTANCE
(PROVE-LEMMA REMAINDER-TIMES-TIMES-PROOF NIL
(EQUAL (REMAINDER (TIMES X Y) (TIMES X Z))
(TIMES X (REMAINDER Y Z)))
((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, rewriting with REMAINDER-NOOP, to two new formulas:
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))),
which again simplifies, rewriting with the lemmas TIMES-ZERO,
EQUAL-TIMES-0, and COMMUTATIVITY-OF-TIMES, and opening up the functions
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 the definitions of 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, rewriting with 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 conjectures:
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, expanding the functions 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, unfolding the function LESSP, to:
T.
Q.E.D.
[ 0.0 0.5 0.0 ]
REMAINDER-TIMES-TIMES-PROOF
(PROVE-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.3 0.0 ]
REMAINDER-TIMES-TIMES
(DISABLE REMAINDER-TIMES-TIMES)
[ 0.0 0.0 0.0 ]
REMAINDER-TIMES-TIMES-OFF
(PROVE-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 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 REMAINDER-OF-NON-NUMBER,
EQUAL-TIMES-0, and COMMUTATIVITY-OF-TIMES, and expanding LESSP, EQUAL,
NUMBERP, REMAINDER, QUOTIENT, 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.1 0.0 ]
REMAINDER-TIMES2-PROOF
(PROVE-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.4 0.0 ]
REMAINDER-TIMES2
(PROVE-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
(PROVE-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)
(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
REMAINDER-OF-NON-NUMBER and DIFFERENCE-LEQ-ARG1, and expanding LESSP, EQUAL,
NUMBERP, and REMAINDER, 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
REMAINDER-ZERO, and unfolding the function ZEROP, 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
REMAINDER-ZERO, and opening up ZEROP, 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
(PROVE-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)
(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, REMAINDER-PLUS, 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 1.2 0.0 ]
REMAINDER-DIFFERENCE2
(PROVE-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)
(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.3 2.0 0.0 ]
REMAINDER-DIFFERENCE3
(DISABLE REMAINDER-DIFFERENCE3)
[ 0.0 0.0 0.0 ]
REMAINDER-DIFFERENCE3-OFF
(PROVE-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)
(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
(PROVE-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))
((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, rewriting with REMAINDER-ZERO, and unfolding the functions
ZEROP, LESSP, and EQUAL, 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)),
which simplifies, applying the lemmas REMAINDER-NOOP and PLUS-ZERO-ARG2, and
unfolding the functions EQUAL, LESSP, and ZEROP, to 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)),
which 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
REMAINDER-NOOP, and unfolding the definitions of EQUAL and LESSP, 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, rewriting with the lemma
REMAINDER-NOOP, and unfolding the function LESSP, 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, using linear arithmetic, applying the lemmas
PLUS-ZERO-ARG2, PLUS-DIFFERENCE-ARG2, REMAINDER-NOOP, and
DIFFERENCE-LEQ-ARG1, and expanding AND, ZEROP, IMPLIES, REMAINDER, NUMBERP,
EQUAL, LESSP, and PLUS, to four new conjectures:
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)),
which 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 1.1 0.0 ]
LESSP-PLUS-FACT
(DISABLE LESSP-PLUS-FACT)
[ 0.0 0.0 0.0 ]
LESSP-PLUS-FACT-OFF
(PROVE-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)
(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, REMAINDER-ZERO, CORRECTNESS-OF-CANCEL-EQUAL-PLUS, and
REMAINDER-OF-NON-NUMBER, and opening up the definitions of ZEROP, NUMBERP,
EQUAL, 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, DIFFERENCE-LEQ-ARG1, REMAINDER-NOOP,
and REMAINDER-PLUS, and unfolding EQUAL, DIFFERENCE, AND, ZEROP, IMPLIES,
REMAINDER, NUMBERP, 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 A 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 A 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 A B) A)),
which again simplifies, using linear arithmetic, rewriting with
DIFFERENCE-X-X, REMAINDER-NOOP, and PLUS-ZERO-ARG2, and unfolding the
functions NUMBERP and ZEROP, 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.7 0.0 ]
REMAINDER-PLUS-FACT
(PROVE-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.2 0.0 ]
REMAINDER-PLUS-TIMES-TIMES-PROOF
(PROVE-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 conjecture can be simplified, using the abbreviations IMPLIES and
REMAINDER-TIMES2-INSTANCE, to the goal:
(IMPLIES (AND (IMPLIES (LESSP A B)
(EQUAL (REMAINDER (PLUS A (TIMES B C))
(TIMES B D))
(PLUS A (TIMES B (REMAINDER C D)))))
(LESSP A B))
(AND (EQUAL (REMAINDER (PLUS A (TIMES B C))
(TIMES B D))
(PLUS A (TIMES B (REMAINDER C D))))
(EQUAL (REMAINDER (PLUS A (TIMES C B))
(TIMES D B))
(PLUS A (TIMES (REMAINDER C D) B))))).
This simplifies, applying COMMUTATIVITY-OF-TIMES, and opening up the
definitions of IMPLIES and AND, to:
T.
Q.E.D.
[ 0.0 0.8 0.0 ]
REMAINDER-PLUS-TIMES-TIMES
(PROVE-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)
(DISABLE TIMES-DISTRIBUTES-OVER-PLUS)
(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-TIMES2-INSTANCE, and REMAINDER-PLUS-TIMES-TIMES, and expanding AND,
to:
T.
Q.E.D.
[ 0.0 0.8 0.0 ]
REMAINDER-PLUS-TIMES-TIMES-INSTANCE
(PROVE-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)))
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 REMAINDER-OF-NON-NUMBER, 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, rewriting with REMAINDER-OF-NON-NUMBER, and
unfolding the functions 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))).
However this again simplifies, appealing to the lemma
REMAINDER-OF-NON-NUMBER, and expanding 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, appealing to the lemma REMAINDER-NOOP, 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))).
However this again simplifies, applying REMAINDER-OF-NON-NUMBER, and
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))).
This simplifies, unfolding the definitions of EQUAL, IMPLIES, and REMAINDER,
to:
(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))).
Applying the lemmas DIFFERENCE-ELIM and REMAINDER-QUOTIENT-ELIM, 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 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 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))).
But this further simplifies, expanding the function LESSP, to:
T.
Case 1.3.
(IMPLIES (AND (EQUAL A 0)
(NUMBERP Z)
(EQUAL (LESSP Z B) (NOT (ZEROP B)))
(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, rewriting with CORRECTNESS-OF-CANCEL-LESSP-PLUS,
REMAINDER-ZERO, REMAINDER-TIMES1, and REMAINDER-PLUS, and opening up the
functions ZEROP, NOT, and EQUAL, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (NUMBERP A))
(NUMBERP Z)
(EQUAL (LESSP Z B) (NOT (ZEROP B)))
(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, REMAINDER-TIMES1, and
REMAINDER-PLUS, and expanding the definitions of ZEROP, NOT, and EQUAL, to:
T.
Case 1.1.
(IMPLIES (AND (NUMBERP X)
(EQUAL (LESSP X A) (NOT (ZEROP A)))
(NUMBERP W)
(NUMBERP A)
(NOT (EQUAL A 0))
(EQUAL (LESSP (PLUS X (TIMES A W)) B)
(NOT (ZEROP B)))
(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, rewriting with ASSOCIATIVITY-OF-PLUS,
CORRECTNESS-OF-CANCEL-LESSP-PLUS, REMAINDER-TIMES1,
REMAINDER-TIMES1-INSTANCE, REMAINDER-NOOP, and REMAINDER-PLUS, and
unfolding ZEROP, NOT, EQUAL, and PLUS, to:
T.
Q.E.D.
[ 0.0 0.8 0.0 ]
REMAINDER-REMAINDER
(PROVE-LEMMA REMAINDER-1-ARG1
(REWRITE)
(EQUAL (REMAINDER 1 X)
(IF (EQUAL X 1) 0 1))
((DISABLE REMAINDER-ADD1)))
This simplifies, rewriting with REMAINDER-NOOP and 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
(PROVE-LEMMA REMAINDER-1-ARG2
(REWRITE)
(EQUAL (REMAINDER Y 1) 0))
.
Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace Y by
(PLUS X (TIMES 1 Z)) to eliminate (REMAINDER Y 1) and (QUOTIENT Y 1). 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 four new formulas:
Case 4. (IMPLIES (NOT (NUMBERP Y))
(EQUAL (REMAINDER Y 1) 0)),
which simplifies, applying REMAINDER-OF-NON-NUMBER, and expanding the
definitions of REMAINDER and EQUAL, to:
T.
Case 3. (IMPLIES (EQUAL 1 0)
(EQUAL (REMAINDER Y 1) 0)).
This simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (NOT (NUMBERP 1))
(EQUAL (REMAINDER Y 1) 0)),
which simplifies, obviously, to:
T.
Case 1. (IMPLIES (AND (NUMBERP X)
(EQUAL (LESSP X 1) (NOT (ZEROP 1)))
(NUMBERP Z)
(NOT (EQUAL 1 0)))
(EQUAL X 0)).
This simplifies, unfolding the definitions of ZEROP, NOT, and EQUAL, to:
(IMPLIES (AND (NUMBERP X)
(LESSP X 1)
(NUMBERP Z))
(EQUAL X 0)).
This again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-1-ARG2
(PROVE-LEMMA REMAINDER-X-X
(REWRITE)
(EQUAL (REMAINDER X X) 0)
((ENABLE EQUAL-DIFFERENCE-0)))
This conjecture simplifies, rewriting with REMAINDER-NOOP and DIFFERENCE-X-X,
and expanding the functions EQUAL, LESSP, NUMBERP, and REMAINDER, to:
(IMPLIES (AND (NOT (EQUAL X 0)) (NUMBERP X))
(NOT (LESSP X X))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-X-X
(PROVE-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)))
.
Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace A by
(PLUS X (TIMES B Z)) to eliminate (REMAINDER A B) and (QUOTIENT A B). 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. This generates four new formulas:
Case 4. (IMPLIES (AND (NOT (NUMBERP A))
(EQUAL (REMAINDER A B) 0)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER A C) 0)),
which simplifies, rewriting with REMAINDER-OF-NON-NUMBER, and expanding the
functions LESSP, EQUAL, NUMBERP, and REMAINDER, to:
T.
Case 3. (IMPLIES (AND (EQUAL B 0)
(EQUAL (REMAINDER A B) 0)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER A C) 0)).
However this simplifies, appealing to the lemmas REMAINDER-ZERO and
REMAINDER-OF-NON-NUMBER, and unfolding ZEROP, LESSP, EQUAL, NUMBERP, and
REMAINDER, to:
T.
Case 2. (IMPLIES (AND (NOT (NUMBERP B))
(EQUAL (REMAINDER A B) 0)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER A C) 0)),
which simplifies, rewriting with REMAINDER-ZERO and REMAINDER-OF-NON-NUMBER,
and unfolding the definitions of ZEROP, LESSP, EQUAL, NUMBERP, and REMAINDER,
to:
T.
Case 1. (IMPLIES (AND (NUMBERP X)
(EQUAL (LESSP X B) (NOT (ZEROP B)))
(NUMBERP Z)
(NUMBERP B)
(NOT (EQUAL B 0))
(EQUAL X 0)
(EQUAL (REMAINDER B C) 0))
(EQUAL (REMAINDER (PLUS X (TIMES B Z)) C)
0)).
However this simplifies, applying the lemma REMAINDER-TIMES1, and opening up
NUMBERP, EQUAL, LESSP, ZEROP, NOT, and PLUS, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
TRANSITIVITY-OF-DIVIDES
(PROVE-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)).
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace A by
(PLUS Z (TIMES 1 X)) to eliminate (QUOTIENT A 1) and (REMAINDER A 1). We
rely upon 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. This produces the following three
new formulas:
Case 1.3.
(IMPLIES (AND (EQUAL 1 0) (NUMBERP A))
(EQUAL (QUOTIENT A 1) A)).
But this further simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (NUMBERP 1)) (NUMBERP A))
(EQUAL (QUOTIENT A 1) A)),
which further simplifies, trivially, to:
T.
Case 1.1.
(IMPLIES (AND (NUMBERP X)
(NUMBERP Z)
(EQUAL (LESSP Z 1) (NOT (ZEROP 1)))
(NOT (EQUAL 1 0)))
(EQUAL X (PLUS Z (TIMES 1 X)))).
This further simplifies, rewriting with TIMES-1-ARG1,
COMMUTATIVITY-OF-PLUS, and CORRECTNESS-OF-CANCEL-EQUAL-PLUS, and expanding
the definitions of ZEROP, NOT, EQUAL, and FIX, to:
(IMPLIES (AND (NUMBERP X)
(NUMBERP Z)
(LESSP Z 1))
(EQUAL 0 Z)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-NOOP
(PROVE-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
(PROVE-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
(PROVE-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)
(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 lemmas REMAINDER-ZERO,
SUB1-TYPE-RESTRICTION, and QUOTIENT-ZERO, and unfolding ZEROP, ADD1,
QUOTIENT, and EQUAL, 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 REMAINDER-NOOP,
DIFFERENCE-LEQ-ARG1, SUB1-TYPE-RESTRICTION, and QUOTIENT-OF-NON-NUMBER, and
opening up the functions 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,
REMAINDER-1-ARG2, SUB1-TYPE-RESTRICTION, and QUOTIENT-OF-NON-NUMBER, and
opening up the definitions of EQUAL, LESSP, DIFFERENCE, IMPLIES, REMAINDER,
QUOTIENT, and ADD1, 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 lemmas DIFFERENCE-ELIM and REMAINDER-QUOTIENT-ELIM, replace A
by (PLUS B X) to eliminate (DIFFERENCE A B) and X by (PLUS V (TIMES B Z)) to
eliminate (QUOTIENT X B) and (REMAINDER X B). 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. 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 Z)
(NUMBERP V)
(EQUAL (LESSP V B) (NOT (ZEROP B)))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (PLUS B V (TIMES B Z)) B))
(NOT (EQUAL B 1))
(EQUAL (QUOTIENT (ADD1 (PLUS V (TIMES B Z)))
B)
Z)
(EQUAL V 0))
(EQUAL (QUOTIENT (ADD1 (PLUS B V (TIMES B Z)))
B)
(ADD1 Z))),
which further simplifies, rewriting with LESSP-PLUS-TIMES1,
DIFFERENCE-SUB1-ARG2, CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and SUB1-ADD1,
and opening up NUMBERP, EQUAL, LESSP, ZEROP, NOT, PLUS, FIX, DIFFERENCE,
and QUOTIENT, to the following two new conjectures:
Case 1.1.2.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP B B))
(NOT (EQUAL B 1))
(EQUAL (QUOTIENT (ADD1 (TIMES B Z)) B)
Z)
(LESSP (PLUS B (TIMES B Z)) (SUB1 B)))
(EQUAL 0 (ADD1 Z))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.1.1.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL Z 0))
(NOT (EQUAL B 1))
(EQUAL (QUOTIENT (ADD1 (TIMES B Z)) B)
Z)
(LESSP (PLUS B (TIMES B Z)) (SUB1 B)))
(EQUAL 0 (ADD1 Z))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.7 0.0 ]
QUOTIENT-ADD1
(PROVE-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, rewriting with the lemma QUOTIENT-ZERO, and opening up the
definitions of ZEROP, EQUAL, 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, expanding the definitions of ZEROP, OR, QUOTIENT, EQUAL,
and ADD1, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
EQUAL-QUOTIENT-0
(PROVE-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))))
((DISABLE EQUAL-DIFFERENCE-0 REMAINDER-QUOTIENT-ELIM)
(ENABLE QUOTIENT-NOOP EQUAL-QUOTIENT-0)
(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 lemmas
DIFFERENCE-LEQ-ARG1 and REMAINDER-NOOP, and unfolding the definitions of
QUOTIENT, LESSP, EQUAL, and ADD1, 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, using linear arithmetic, rewriting with REMAINDER-NOOP,
EQUAL-QUOTIENT-0, and SUB1-ADD1, and opening up the definitions of ZEROP,
NOT, AND, IMPLIES, NUMBERP, REMAINDER, EQUAL, QUOTIENT, LESSP, ADD1, and
SUB1, to the following three new conjectures:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(EQUAL (DIFFERENCE A B) 0)
(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, using linear arithmetic, rewriting with
PLUS-ZERO-ARG2 and REMAINDER-NOOP, and unfolding the definitions of
NUMBERP, ZEROP, and EQUAL, 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, REMAINDER-NOOP, and DIFFERENCE-LEQ-ARG1, and
expanding NUMBERP, ZEROP, EQUAL, SUB1, LESSP, 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, EQUAL-QUOTIENT-0,
and REMAINDER-NOOP, and opening up the definition of LESSP, to:
T.
Q.E.D.
[ 0.0 0.8 0.1 ]
QUOTIENT-SUB1
(PROVE-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)
(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 lemmas REMAINDER-ZERO, PLUS-ZERO-ARG2, and
QUOTIENT-ZERO, and unfolding ZEROP, QUOTIENT, PLUS, and EQUAL, 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, PLUS-ZERO-ARG2, and
QUOTIENT-OF-NON-NUMBER, 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, rewriting with QUOTIENT-OF-NON-NUMBER, and
unfolding the functions 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))).
However this again simplifies, applying QUOTIENT-OF-NON-NUMBER, and
unfolding the definitions of 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)))).
This simplifies, using linear arithmetic, rewriting with PLUS-ZERO-ARG2,
PLUS-DIFFERENCE-ARG2, REMAINDER-NOOP, DIFFERENCE-LEQ-ARG1, PLUS-ADD1-ARG2,
and QUOTIENT-OF-NON-NUMBER, and opening up the definitions of ZEROP, IMPLIES,
REMAINDER, NUMBERP, EQUAL, QUOTIENT, LESSP, ADD1, and PLUS, to 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 (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, using linear arithmetic, to two new goals:
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, expanding 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, appealing to the lemmas DIFFERENCE-X-X,
PLUS-ZERO-ARG2, CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, and
CORRECTNESS-OF-CANCEL-LESSP-PLUS, and expanding 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)),
which again simplifies, opening up 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)).
However this again simplifies, rewriting with the lemmas
QUOTIENT-OF-NON-NUMBER and DIFFERENCE-X-X, and opening up 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)))),
which again simplifies, opening up the definition of QUOTIENT, to:
(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.7 0.0 ]
QUOTIENT-PLUS-PROOF
(PROVE-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.2 0.0 ]
QUOTIENT-PLUS
(PROVE-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 QUOTIENT-ZERO, and opening up
the functions ZEROP 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 REMAINDER-TIMES1-INSTANCE, DIFFERENCE-X-X,
and QUOTIENT-PLUS, and expanding the functions ZEROP, TIMES, EQUAL, QUOTIENT,
LESSP, and ADD1, to the following two new conjectures:
Case 1.2.
(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 Y Y)))
(EQUAL (PLUS (SUB1 X) 1) X)).
This again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL X 0))
(EQUAL (QUOTIENT (TIMES (SUB1 X) Y) Y)
(SUB1 X))
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP X)
(LESSP Y Y))
(EQUAL (PLUS (SUB1 X) 0) X)),
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
(PROVE-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 lemmas COMMUTATIVITY-OF-TIMES, TIMES-ZERO,
and QUOTIENT-ZERO, and unfolding the definitions of ZEROP, FIX, EQUAL, TIMES,
LESSP, QUOTIENT, and AND, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
QUOTIENT-TIMES-INSTANCE-TEMP
(DISABLE QUOTIENT-TIMES-INSTANCE-TEMP)
[ 0.0 0.0 0.0 ]
QUOTIENT-TIMES-INSTANCE-TEMP-OFF
(PROVE-LEMMA QUOTIENT-TIMES-PROOF NIL
(IMPLIES (EQUAL (REMAINDER A C) 0)
(EQUAL (QUOTIENT (TIMES A B) C)
(TIMES B (QUOTIENT A C))))
((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, COMMUTATIVITY-OF-TIMES,
and QUOTIENT-ZERO, 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, COMMUTATIVITY-OF-TIMES, and
QUOTIENT-OF-NON-NUMBER, 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 0.9 0.0 ]
QUOTIENT-TIMES-PROOF
(PROVE-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.1 0.0 ]
QUOTIENT-TIMES
(PROVE-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 COMMUTATIVITY-OF-TIMES, REMAINDER-X-X,
DIFFERENCE-X-X, and QUOTIENT-TIMES, and unfolding the definitions of EQUAL,
QUOTIENT, LESSP, ADD1, ZEROP, and FIX, to six new formulas:
Case 2.6.
(IMPLIES (EQUAL Y 0)
(EQUAL (TIMES X 0) 0)),
which again simplifies, rewriting with COMMUTATIVITY-OF-TIMES, and
expanding the functions EQUAL and TIMES, to:
T.
Case 2.5.
(IMPLIES (NOT (NUMBERP Y))
(EQUAL (TIMES X 0) 0)).
However this again simplifies, applying COMMUTATIVITY-OF-TIMES, and
opening up the functions EQUAL and TIMES, to:
T.
Case 2.4.
(IMPLIES (AND (NOT (NUMBERP X)) (LESSP Y Y))
(EQUAL (TIMES X 0) 0)).
But this again simplifies, using linear arithmetic, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP X)
(NOT (LESSP Y Y)))
(EQUAL (TIMES X 1) X)),
which again simplifies, applying TIMES-1-ARG1 and COMMUTATIVITY-OF-TIMES,
to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP X)
(LESSP Y Y))
(EQUAL (TIMES X 0) X)).
This again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (NUMBERP X))
(NOT (LESSP Y Y)))
(EQUAL (TIMES X 1) 0)),
which again simplifies, appealing to the lemmas TIMES-1-ARG1 and
COMMUTATIVITY-OF-TIMES, and opening up the definition of EQUAL, to:
T.
Case 1. (EQUAL (QUOTIENT (TIMES X Y) Y)
(IF (ZEROP Y) 0 (FIX X))),
which simplifies, rewriting with REMAINDER-X-X, DIFFERENCE-X-X, and
QUOTIENT-TIMES, and unfolding the definitions of EQUAL, QUOTIENT, LESSP,
ADD1, ZEROP, and FIX, to the following six new conjectures:
Case 1.6.
(IMPLIES (EQUAL Y 0)
(EQUAL (TIMES X 0) 0)).
However this again simplifies, applying COMMUTATIVITY-OF-TIMES, and
unfolding EQUAL and TIMES, to:
T.
Case 1.5.
(IMPLIES (NOT (NUMBERP Y))
(EQUAL (TIMES X 0) 0)).
But this again simplifies, applying COMMUTATIVITY-OF-TIMES, and opening up
EQUAL and TIMES, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (NUMBERP X)) (LESSP Y Y))
(EQUAL (TIMES X 0) 0)).
This again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP X)
(NOT (LESSP Y Y)))
(EQUAL (TIMES X 1) X)),
which again simplifies, appealing to the lemmas TIMES-1-ARG1 and
COMMUTATIVITY-OF-TIMES, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP X)
(LESSP Y Y))
(EQUAL (TIMES X 0) X)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (NUMBERP X))
(NOT (LESSP Y Y)))
(EQUAL (TIMES X 1) 0)),
which again simplifies, rewriting with the lemmas TIMES-1-ARG1 and
COMMUTATIVITY-OF-TIMES, and unfolding EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-TIMES-INSTANCE
(PROVE-LEMMA QUOTIENT-TIMES-TIMES-PROOF NIL
(EQUAL (QUOTIENT (TIMES X Y) (TIMES X Z))
(IF (ZEROP X) 0 (QUOTIENT Y Z)))
((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, QUOTIENT-ZERO, and
TIMES-ZERO, and opening up the definitions of ZEROP, EQUAL, and TIMES, 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, applying EQUAL-TIMES-0, CORRECTNESS-OF-CANCEL-LESSP-TIMES,
and EQUAL-QUOTIENT-0, and unfolding the definitions of ZEROP, QUOTIENT, NOT,
FIX, and AND, to:
(IMPLIES (AND (NOT (EQUAL Z 0))
(NUMBERP Z)
(LESSP Y Z)
(NOT (EQUAL X 0))
(NUMBERP X)
(NOT (NUMBERP Y)))
(LESSP 0 Z)).
But this again simplifies, using linear arithmetic, 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, appealing to the lemmas TIMES-DISTRIBUTES-OVER-DIFFERENCE,
CORRECTNESS-OF-CANCEL-LESSP-TIMES, and EQUAL-TIMES-0, and expanding ZEROP,
TIMES, QUOTIENT, EQUAL, AND, FIX, and NOT, to:
(IMPLIES (AND (NOT (EQUAL Z 0))
(NUMBERP Z)
(NOT (LESSP Y Z))
(NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (QUOTIENT (DIFFERENCE (TIMES X Y) (TIMES X Z))
(TIMES X Z))
(QUOTIENT (DIFFERENCE Y Z) Z))
(NOT (NUMBERP Y))
(LESSP 0 Z))
(EQUAL 0
(ADD1 (QUOTIENT (DIFFERENCE Y Z) Z)))).
But this again simplifies, unfolding the function LESSP, to:
T.
Q.E.D.
[ 0.0 0.5 0.0 ]
QUOTIENT-TIMES-TIMES-PROOF
(PROVE-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, EQUAL-TIMES-0,
QUOTIENT-OF-NON-NUMBER, TIMES-ZERO, and QUOTIENT-ZERO, and opening up the
definitions of ZEROP, TIMES, LESSP, EQUAL, QUOTIENT, and AND, to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
QUOTIENT-TIMES-TIMES
(DISABLE QUOTIENT-TIMES-TIMES)
[ 0.0 0.0 0.0 ]
QUOTIENT-TIMES-TIMES-OFF
(PROVE-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 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
QUOTIENT-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 lemmas REMAINDER-ZERO and
QUOTIENT-ZERO, and expanding ZEROP, LESSP, and QUOTIENT, 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 lemmas REMAINDER-ZERO and
QUOTIENT-ZERO, and expanding the functions ZEROP 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,
DIFFERENCE-LEQ-ARG1, and QUOTIENT-OF-NON-NUMBER, 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, REMAINDER-ZERO, and QUOTIENT-ZERO, and
opening up the definitions of ZEROP, PLUS, DIFFERENCE, and EQUAL, 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,
REMAINDER-ZERO, and QUOTIENT-ZERO, and opening up the definitions of ZEROP,
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
(PROVE-LEMMA QUOTIENT-LESSP-ARG1
(REWRITE)
(IMPLIES (LESSP A B)
(EQUAL (QUOTIENT A B) 0)))
This conjecture can be simplified, using the abbreviations EQUAL-QUOTIENT-0
and IMPLIES, to:
T.
This simplifies, obviously, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-LESSP-ARG1
(PROVE-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)))
((DISABLE TIMES-DISTRIBUTES-OVER-PLUS QUOTIENT-DIFFERENCE1
DIFFERENCE-LEQ-ARG1 REMAINDER-DIFFERENCE2
EQUAL-REMAINDER-DIFFERENCE-0 REMAINDER-DIFFERENCE3)
(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, rewriting with REMAINDER-ZERO and QUOTIENT-ZERO, and
opening up the definitions of ZEROP, EQUAL, DIFFERENCE, QUOTIENT, 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
QUOTIENT-LESSP-ARG1, and opening up EQUAL, DIFFERENCE, 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 (QUOTIENT (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE (QUOTIENT A C)
(ADD1 (QUOTIENT B C)))
0))).
This simplifies, rewriting with REMAINDER-NOOP, QUOTIENT-LESSP-ARG1,
EQUAL-QUOTIENT-0, and DIFFERENCE-ADD1-ARG2, and opening up the functions
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))
C)))),
which further simplifies, applying the lemmas
CORRECTNESS-OF-CANCEL-LESSP-PLUS, REMAINDER-TIMES1-INSTANCE,
REMAINDER-PLUS, EQUAL-PLUS-0, EQUAL-TIMES-0, QUOTIENT-TIMES-INSTANCE,
COMMUTATIVITY-OF-PLUS, and QUOTIENT-PLUS, and expanding the functions
ZEROP, NOT, and EQUAL, to two new goals:
Case 2.1.1.2.
(IMPLIES (AND (NUMBERP Z)
(NUMBERP V)
(LESSP V C)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (PLUS B V (TIMES C Z)) C))
(LESSP B C)
(EQUAL (REMAINDER (PLUS B V) C) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(NOT (EQUAL V 0)))
(EQUAL Z
(SUB1 (PLUS Z (QUOTIENT (PLUS B V) C))))),
which again simplifies, using linear arithmetic, rewriting with
REMAINDER-NOOP, QUOTIENT-LESSP-ARG1, PLUS-ZERO-ARG2, PLUS-ADD1-ARG2,
and SUB1-ADD1, and opening up the definitions of REMAINDER, ADD1,
QUOTIENT, NUMBERP, and ZEROP, to:
(IMPLIES (AND (NUMBERP Z)
(NUMBERP V)
(LESSP V C)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (PLUS B V (TIMES C Z)) C))
(LESSP B C)
(LESSP (PLUS B V) C)
(EQUAL (PLUS B V) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(NOT (EQUAL V 0)))
(EQUAL Z (SUB1 Z))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.1.1.
(IMPLIES (AND (NUMBERP Z)
(NUMBERP V)
(LESSP V C)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (PLUS B V (TIMES C Z)) C))
(LESSP B C)
(EQUAL (REMAINDER (PLUS B V) C) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(NOT (EQUAL Z 0)))
(EQUAL Z
(SUB1 (PLUS Z (QUOTIENT (PLUS B V) C))))),
which again simplifies, using linear arithmetic, rewriting with
REMAINDER-NOOP, QUOTIENT-LESSP-ARG1, PLUS-ZERO-ARG2, PLUS-ADD1-ARG2,
and SUB1-ADD1, and expanding the functions REMAINDER, ADD1, QUOTIENT,
NUMBERP, and ZEROP, to the new goal:
(IMPLIES (AND (NUMBERP Z)
(NUMBERP V)
(LESSP V C)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP (PLUS B V (TIMES C Z)) C))
(LESSP B C)
(LESSP (PLUS B V) C)
(EQUAL (PLUS B V) 0)
(NUMBERP B)
(NOT (EQUAL B 0))
(NOT (EQUAL Z 0)))
(EQUAL Z (SUB1 Z))),
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 (QUOTIENT (DIFFERENCE A
(PLUS C (DIFFERENCE B C)))
C)
(IF (LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(ADD1 (QUOTIENT (DIFFERENCE B C) C)))
0)))
(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, appealing to the lemmas
COMMUTATIVITY-OF-PLUS, CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS, PLUS-ZERO-ARG2,
PLUS-DIFFERENCE-ARG2, DIFFERENCE-ADD1-ARG2, REMAINDER-NOOP,
EQUAL-DIFFERENCE-0, SUB1-ADD1, EQUAL-QUOTIENT-0, DIFFERENCE-SUB1-ARG2, and
REMAINDER-OF-NON-NUMBER, and expanding the functions NOT, AND, FIX, ZEROP,
IMPLIES, REMAINDER, EQUAL, LESSP, QUOTIENT, DIFFERENCE, and NUMBERP, to nine
new formulas:
Case 1.9.
(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 (QUOTIENT (DIFFERENCE A B) C)
0)
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(LESSP B A)
(LESSP (QUOTIENT (DIFFERENCE B C) C)
(QUOTIENT (DIFFERENCE A C) C))
(LESSP (DIFFERENCE B C) C))
(EQUAL 0
(SUB1 (SUB1 (ADD1 (QUOTIENT (DIFFERENCE A C) C)))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.8.
(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 (QUOTIENT (DIFFERENCE A B) C)
0)
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(LESSP B A)
(LESSP (QUOTIENT (DIFFERENCE B C) C)
(QUOTIENT (DIFFERENCE A C) C))
(NOT (LESSP (DIFFERENCE B C) C))
(NOT (LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))))
(EQUAL 0 (SUB1 0))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (EQUAL (QUOTIENT (DIFFERENCE B C) C)
0)
(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 (QUOTIENT (DIFFERENCE A B) C)
0)
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(LESSP B A)
(LESSP (QUOTIENT (DIFFERENCE B C) C)
(QUOTIENT (DIFFERENCE A C) C))
(NOT (LESSP (DIFFERENCE B C) C))
(NOT (LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))))
(EQUAL 0 (SUB1 0))).
This 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))
(NOT (LESSP (DIFFERENCE B C)
(DIFFERENCE A C)))
(LESSP C B)
(NUMBERP B)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
0)
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(LESSP B A)
(LESSP (QUOTIENT (DIFFERENCE B C) C)
(QUOTIENT (DIFFERENCE A C) C))
(NOT (LESSP (DIFFERENCE B C) C))
(LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))
(NOT (LESSP (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL 0
(SUB1 (SUB1 (ADD1 (DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))))),
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)
(NUMBERP B)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
0)
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(LESSP B A)
(LESSP (QUOTIENT (DIFFERENCE B C) C)
(QUOTIENT (DIFFERENCE A C) C))
(NOT (LESSP (DIFFERENCE B C) C))
(LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))
(LESSP (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C)))
(EQUAL 0 (SUB1 (SUB1 0)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.5.
(IMPLIES
(AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(LESSP (QUOTIENT (DIFFERENCE B C) C)
(QUOTIENT (DIFFERENCE A C) C))
(LESSP C B)
(NUMBERP B)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 (DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(NOT (LESSP B A)))
(EQUAL (QUOTIENT (DIFFERENCE A B) 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))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(LESSP (QUOTIENT (DIFFERENCE B C) C)
(QUOTIENT (DIFFERENCE A C) C))
(LESSP C B)
(NUMBERP B)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 (DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(LESSP B A)
(NOT (LESSP (DIFFERENCE B C) C))
(LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))
(LESSP (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C)))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 (SUB1 0)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES
(AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(LESSP (QUOTIENT (DIFFERENCE B C) C)
(QUOTIENT (DIFFERENCE A C) C))
(LESSP C B)
(NUMBERP B)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 (DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(LESSP B A)
(NOT (LESSP (DIFFERENCE B C) C))
(LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))
(NOT (LESSP (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL
(QUOTIENT (DIFFERENCE A B) C)
(SUB1 (SUB1 (ADD1 (DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))))),
which again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (EQUAL (SUB1 (ADD1 (DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))
0)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(LESSP (QUOTIENT (DIFFERENCE B C) C)
(QUOTIENT (DIFFERENCE A C) C))
(LESSP C B)
(NUMBERP B)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 (DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(LESSP B A)
(NOT (LESSP (DIFFERENCE B C) C))
(LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))
(NOT (LESSP (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL
(QUOTIENT (DIFFERENCE A B) C)
(SUB1 (SUB1 (ADD1 (DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))))).
But this 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))
(LESSP (QUOTIENT (DIFFERENCE B C) C)
(QUOTIENT (DIFFERENCE A C) C))
(LESSP C B)
(NUMBERP B)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 (DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(LESSP B A)
(NOT (LESSP (DIFFERENCE B C) C))
(NOT (LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 0))),
which again simplifies, using linear arithmetic, to two new conjectures:
Case 1.2.2.
(IMPLIES
(AND (EQUAL (QUOTIENT (DIFFERENCE B C) C)
0)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(LESSP (QUOTIENT (DIFFERENCE B C) C)
(QUOTIENT (DIFFERENCE A C) C))
(LESSP C B)
(NUMBERP B)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 (DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(LESSP B A)
(NOT (LESSP (DIFFERENCE B C) C))
(NOT (LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 0))),
which again simplifies, applying the lemma EQUAL-QUOTIENT-0, to:
T.
Case 1.2.1.
(IMPLIES
(AND (LESSP (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(LESSP (QUOTIENT (DIFFERENCE B C) C)
(QUOTIENT (DIFFERENCE A C) C))
(LESSP C B)
(NUMBERP B)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 (DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(LESSP B A)
(NOT (LESSP (DIFFERENCE B C) C))
(NOT (LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 0))),
which again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (EQUAL (QUOTIENT (DIFFERENCE B C) C)
0)
(LESSP (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(LESSP (QUOTIENT (DIFFERENCE B C) C)
(QUOTIENT (DIFFERENCE A C) C))
(LESSP C B)
(NUMBERP B)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 (DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(LESSP B A)
(NOT (LESSP (DIFFERENCE B C) C))
(NOT (LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 0))).
However 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))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(LESSP (QUOTIENT (DIFFERENCE B C) C)
(QUOTIENT (DIFFERENCE A C) C))
(LESSP C B)
(NUMBERP B)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 (DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL (REMAINDER (DIFFERENCE A C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE B C) C)
0))
(LESSP B A)
(LESSP (DIFFERENCE B C) C))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 (SUB1 (ADD1 (QUOTIENT (DIFFERENCE A C) C)))))),
which again simplifies, applying QUOTIENT-LESSP-ARG1, EQUAL-QUOTIENT-0,
REMAINDER-NOOP, EQUAL-DIFFERENCE-0, and SUB1-ADD1, and unfolding EQUAL,
LESSP, and DIFFERENCE, to:
T.
Q.E.D.
[ 0.0 1.1 0.0 ]
QUOTIENT-DIFFERENCE2
(PROVE-LEMMA QUOTIENT-DIFFERENCE3
(REWRITE)
(IMPLIES (AND (EQUAL (REMAINDER B C) 0)
(NOT (EQUAL (REMAINDER A C) 0)))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE (QUOTIENT A C)
(QUOTIENT B C))
0)))
((DISABLE TIMES-DISTRIBUTES-OVER-PLUS REMAINDER-DIFFERENCE1
DIFFERENCE-DIFFERENCE-ARG1 EQUAL-REMAINDER-DIFFERENCE-0
DIFF-DIFF-ARG1 REMAINDER-NOOP REMAINDER-QUOTIENT-ELIM
REMAINDER-DIFFERENCE3 QUOTIENT-DIFFERENCE1)
(INDUCT (DOUBLE-REMAINDER-INDUCTION A B C))))
This formula can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to the following four new goals:
Case 4. (IMPLIES (AND (ZEROP C)
(EQUAL (REMAINDER B C) 0)
(NOT (EQUAL (REMAINDER A C) 0)))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE (QUOTIENT A C)
(QUOTIENT B C))
0))).
This simplifies, applying REMAINDER-ZERO and QUOTIENT-ZERO, and expanding
the definitions of ZEROP, EQUAL, DIFFERENCE, LESSP, and QUOTIENT, 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 (QUOTIENT (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE (QUOTIENT A C)
(QUOTIENT B C))
0))),
which simplifies, using linear arithmetic, applying the lemmas
QUOTIENT-LESSP-ARG1 and DIFFERENCE-LEQ-ARG1, and expanding REMAINDER and
EQUAL, to the formula:
(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 (QUOTIENT (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE (QUOTIENT A C)
(QUOTIENT B C))
0))).
However this again simplifies, using linear arithmetic, applying
DIFFERENCE-LEQ-ARG1 and QUOTIENT-LESSP-ARG1, and unfolding EQUAL, 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 (QUOTIENT (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE (QUOTIENT A C)
(QUOTIENT B C))
0))).
This simplifies, using linear arithmetic, rewriting with QUOTIENT-LESSP-ARG1
and EQUAL-QUOTIENT-0, and unfolding REMAINDER, 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 (QUOTIENT 0 C) 0)),
which again simplifies, unfolding 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 (QUOTIENT 0 C) 0)),
which again simplifies, obviously, 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 (QUOTIENT 0 C) 0)).
This again simplifies, unfolding the definition of 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 (QUOTIENT 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 (QUOTIENT (DIFFERENCE (DIFFERENCE A C)
(DIFFERENCE B C))
C)
(IF (LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))
0)))
(EQUAL (REMAINDER B C) 0)
(NOT (EQUAL (REMAINDER A C) 0)))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(IF (LESSP B A)
(DIFFERENCE (QUOTIENT A C)
(QUOTIENT B C))
0))),
which simplifies, rewriting with CORRECTNESS-OF-CANCEL-DIFFERENCE-PLUS,
PLUS-DIFFERENCE-ARG1, DIFFERENCE-DIFFERENCE-ARG2, DIFFERENCE-LEQ-ARG1,
SUB1-ADD1, EQUAL-QUOTIENT-0, DIFFERENCE-SUB1-ARG2, DIFFERENCE-ADD1-ARG2, and
REMAINDER-OF-NON-NUMBER, and unfolding the functions NOT, AND, FIX, EQUAL,
PLUS, IMPLIES, REMAINDER, NUMBERP, LESSP, QUOTIENT, and DIFFERENCE, to the
following eight new conjectures:
Case 1.8.
(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 A)
(NUMBERP A)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
0)
(EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(LESSP B A)
(NOT (LESSP (DIFFERENCE B C) C))
(LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))
(LESSP (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C)))
(EQUAL 0 (SUB1 0))).
However this 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))
(NOT (LESSP (DIFFERENCE B C)
(DIFFERENCE A C)))
(LESSP C A)
(NUMBERP A)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
0)
(EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(LESSP B A)
(NOT (LESSP (DIFFERENCE B C) C))
(LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))
(NOT (LESSP (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL 0
(SUB1 (ADD1 (DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C)))))),
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 A)
(NUMBERP A)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
0)
(EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(LESSP B A)
(LESSP (DIFFERENCE B C) C))
(EQUAL 0
(SUB1 (ADD1 (QUOTIENT (DIFFERENCE A C) C))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.5.
(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 A)
(NUMBERP A)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C)))
(EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(NOT (LESSP (DIFFERENCE B C) C))
(NOT (LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
0)),
which again simplifies, using linear arithmetic, to two new goals:
Case 1.5.2.
(IMPLIES (AND (EQUAL (QUOTIENT (DIFFERENCE B C) C)
0)
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(LESSP C A)
(NUMBERP A)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C)))
(EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(NOT (LESSP (DIFFERENCE B C) C))
(NOT (LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
0)),
which again simplifies, applying EQUAL-QUOTIENT-0, to:
T.
Case 1.5.1.
(IMPLIES (AND (LESSP (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(LESSP C A)
(NUMBERP A)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C)))
(EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(NOT (LESSP (DIFFERENCE B C) C))
(NOT (LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
0)).
This again simplifies, using linear arithmetic, rewriting with
DIFFERENCE-LEQ-ARG1, EQUAL-QUOTIENT-0, and QUOTIENT-LESSP-ARG1, and
opening up SUB1, EQUAL, and LESSP, to the new goal:
(IMPLIES (AND (LESSP (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(LESSP C A)
(NUMBERP A)
(EQUAL (QUOTIENT (DIFFERENCE B C) C)
0)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C)))
(EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(NOT (LESSP (DIFFERENCE B C) C))
(LESSP (DIFFERENCE A C) C))
(LESSP (DIFFERENCE A B) C)),
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))
(LESSP (DIFFERENCE B C)
(DIFFERENCE A C))
(LESSP C A)
(NUMBERP A)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C)))
(EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(NOT (LESSP B A)))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
0)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(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 A)
(NUMBERP A)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C)))
(EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(LESSP B A)
(NOT (LESSP (DIFFERENCE B C) C))
(LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))
(LESSP (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C)))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 0))),
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))
(LESSP C A)
(NUMBERP A)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C)))
(EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(LESSP B A)
(NOT (LESSP (DIFFERENCE B C) C))
(LESSP (SUB1 (QUOTIENT (DIFFERENCE B C) C))
(QUOTIENT (DIFFERENCE A C) C))
(NOT (LESSP (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C))))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 (ADD1 (QUOTIENT (DIFFERENCE A B) C))))),
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))
(LESSP C A)
(NUMBERP A)
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(DIFFERENCE (QUOTIENT (DIFFERENCE A C) C)
(QUOTIENT (DIFFERENCE B C) C)))
(EQUAL (REMAINDER (DIFFERENCE B C) C)
0)
(NOT (EQUAL (REMAINDER (DIFFERENCE A C) C)
0))
(LESSP B A)
(LESSP (DIFFERENCE B C) C))
(EQUAL (QUOTIENT (DIFFERENCE A B) C)
(SUB1 (ADD1 (QUOTIENT (DIFFERENCE A C) C))))),
which again simplifies, applying the lemmas QUOTIENT-LESSP-ARG1,
EQUAL-QUOTIENT-0, EQUAL-DIFFERENCE-0, DIFFERENCE-LEQ-ARG1, and SUB1-ADD1,
and opening up EQUAL, DIFFERENCE, REMAINDER, LESSP, ADD1, and SUB1, to:
T.
Q.E.D.
[ 0.0 2.1 0.1 ]
QUOTIENT-DIFFERENCE3
(PROVE-LEMMA REMAINDER-EQUALS-ITS-FIRST-ARGUMENT
(REWRITE)
(EQUAL (EQUAL A (REMAINDER A B))
(AND (NUMBERP A)
(OR (ZEROP B) (LESSP A B))))
((INDUCT (REMAINDER A B))
(ENABLE LESSP-REMAINDER REMAINDER-NOOP REMAINDER-ZERO)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, OR, and
AND, to three new conjectures:
Case 3. (IMPLIES (ZEROP B)
(EQUAL (EQUAL A (REMAINDER A B))
(AND (NUMBERP A)
(OR (ZEROP B) (LESSP A B))))),
which simplifies, applying REMAINDER-ZERO, and unfolding ZEROP, EQUAL, LESSP,
OR, and AND, to the following four new goals:
Case 3.4.
(IMPLIES (AND (EQUAL B 0) (EQUAL A 0))
(EQUAL (NUMBERP A) T)).
This again simplifies, clearly, to:
T.
Case 3.3.
(IMPLIES (AND (EQUAL B 0) (NUMBERP A))
(EQUAL (NUMBERP A) T)).
This again simplifies, trivially, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP B)) (EQUAL A 0))
(EQUAL (NUMBERP A) T)).
This again simplifies, clearly, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (NUMBERP B)) (NUMBERP A))
(EQUAL (NUMBERP A) T)).
This again simplifies, obviously, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(LESSP A B))
(EQUAL (EQUAL A (REMAINDER A B))
(AND (NUMBERP A)
(OR (ZEROP B) (LESSP A B))))).
This simplifies, applying REMAINDER-NOOP, and unfolding the functions ZEROP,
OR, and AND, to two new goals:
Case 2.2.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(LESSP A B)
(EQUAL A 0))
(EQUAL (NUMBERP A) T)),
which again simplifies, obviously, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(LESSP A B)
(NUMBERP A))
(EQUAL (NUMBERP A) T)).
This again simplifies, clearly, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(EQUAL (EQUAL (DIFFERENCE A B)
(REMAINDER (DIFFERENCE A B) B))
(AND (NUMBERP (DIFFERENCE A B))
(OR (ZEROP B)
(LESSP (DIFFERENCE A B) B)))))
(EQUAL (EQUAL A (REMAINDER A B))
(AND (NUMBERP A)
(OR (ZEROP B) (LESSP A B))))).
This simplifies, rewriting with REMAINDER-NOOP, and opening up the
definitions of ZEROP, OR, AND, and REMAINDER, to two new formulas:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(NOT (EQUAL (DIFFERENCE A B)
(REMAINDER (DIFFERENCE A B) B)))
(NOT (LESSP (DIFFERENCE A B) B)))
(NOT (EQUAL A
(REMAINDER (DIFFERENCE A B) B)))),
which again simplifies, trivially, to:
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(NOT (EQUAL (DIFFERENCE A B) A))
(NOT (LESSP (DIFFERENCE A B) B)))
(NOT (EQUAL A
(REMAINDER (DIFFERENCE A B) 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 B V))
to eliminate (REMAINDER X B) and (QUOTIENT X B). 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 two new goals:
Case 1.2.2.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(NOT (EQUAL (DIFFERENCE A B) A))
(NOT (LESSP (DIFFERENCE A B) B)))
(NOT (EQUAL A
(REMAINDER (DIFFERENCE A B) B)))).
This further simplifies, obviously, to:
T.
Case 1.2.1.
(IMPLIES (AND (NUMBERP Z)
(EQUAL (LESSP Z B) (NOT (ZEROP B)))
(NUMBERP V)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP (PLUS B Z (TIMES B V)) B))
(NOT (EQUAL (PLUS Z (TIMES B V))
(PLUS B Z (TIMES B V))))
(NOT (LESSP (PLUS Z (TIMES B V)) B)))
(NOT (EQUAL (PLUS B Z (TIMES B V)) Z))).
However this further simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP A B))
(EQUAL (DIFFERENCE A B)
(REMAINDER (DIFFERENCE A B) B))
(EQUAL (LESSP (DIFFERENCE A B) B) T))
(NOT (EQUAL A (DIFFERENCE A B)))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.5 0.0 ]
REMAINDER-EQUALS-ITS-FIRST-ARGUMENT
(DISABLE REMAINDER-EQUALS-ITS-FIRST-ARGUMENT)
[ 0.0 0.0 0.0 ]
REMAINDER-EQUALS-ITS-FIRST-ARGUMENT-OFF
(PROVE-LEMMA QUOTIENT-REMAINDER-TIMES
(REWRITE)
(EQUAL (QUOTIENT (REMAINDER X (TIMES A B)) A)
(REMAINDER (QUOTIENT X A) B))
((ENABLE REMAINDER-EQUALS-ITS-FIRST-ARGUMENT QUOTIENT-NOOP
QUOTIENT-PLUS QUOTIENT-TIMES-INSTANCE QUOTIENT-ZERO)
(DO-NOT-INDUCT T)))
.
Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace X by:
(PLUS Z (TIMES (TIMES A B) V))
to eliminate (REMAINDER X (TIMES A B)) and (QUOTIENT X (TIMES A B)) and Z by
(PLUS D (TIMES A W)) to eliminate (QUOTIENT Z A) and (REMAINDER Z A). We use
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. The result is six new goals:
Case 6. (IMPLIES (NOT (NUMBERP X))
(EQUAL (QUOTIENT (REMAINDER X (TIMES A B)) A)
(REMAINDER (QUOTIENT X A) B))),
which simplifies, appealing to the lemmas REMAINDER-OF-NON-NUMBER,
QUOTIENT-OF-NON-NUMBER, COMMUTATIVITY-OF-TIMES, and REMAINDER-TIMES2, and
unfolding REMAINDER, NUMBERP, EQUAL, LESSP, QUOTIENT, and TIMES, to:
T.
Case 5. (IMPLIES (EQUAL (TIMES A B) 0)
(EQUAL (QUOTIENT (REMAINDER X (TIMES A B)) A)
(REMAINDER (QUOTIENT X A) B))),
which simplifies, rewriting with the lemmas EQUAL-TIMES-0, REMAINDER-ZERO,
and QUOTIENT-ZERO, and expanding the functions ZEROP, LESSP, EQUAL, NUMBERP,
and REMAINDER, to two new conjectures:
Case 5.2.
(IMPLIES (AND (EQUAL B 0) (NOT (NUMBERP X)))
(EQUAL (QUOTIENT 0 A)
(QUOTIENT X A))),
which again simplifies, applying the lemma QUOTIENT-OF-NON-NUMBER, and
expanding LESSP, EQUAL, and QUOTIENT, to:
T.
Case 5.1.
(IMPLIES (AND (NOT (NUMBERP B))
(NOT (NUMBERP X)))
(EQUAL (QUOTIENT 0 A)
(QUOTIENT X A))),
which again simplifies, applying the lemma QUOTIENT-OF-NON-NUMBER, and
opening up the functions LESSP, EQUAL, and QUOTIENT, to:
T.
Case 4. (IMPLIES (NOT (NUMBERP (TIMES A B)))
(EQUAL (QUOTIENT (REMAINDER X (TIMES A B)) A)
(REMAINDER (QUOTIENT X A) B))),
which simplifies, trivially, to:
T.
Case 3. (IMPLIES (AND (EQUAL A 0)
(NUMBERP Z)
(EQUAL (LESSP Z (TIMES A B))
(NOT (ZEROP (TIMES A B))))
(NUMBERP V)
(NOT (EQUAL (TIMES A B) 0)))
(EQUAL (QUOTIENT Z A)
(REMAINDER (QUOTIENT (PLUS Z (TIMES (TIMES A B) V))
A)
B))).
But this simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (NUMBERP A))
(NUMBERP Z)
(EQUAL (LESSP Z (TIMES A B))
(NOT (ZEROP (TIMES A B))))
(NUMBERP V)
(NOT (EQUAL (TIMES A B) 0)))
(EQUAL (QUOTIENT Z A)
(REMAINDER (QUOTIENT (PLUS Z (TIMES (TIMES A B) V))
A)
B))),
which simplifies, opening up the definitions of TIMES, EQUAL, LESSP, ZEROP,
and NOT, to:
T.
Case 1. (IMPLIES (AND (NUMBERP W)
(NUMBERP D)
(EQUAL (LESSP D A) (NOT (ZEROP A)))
(NUMBERP A)
(NOT (EQUAL A 0))
(EQUAL (LESSP (PLUS D (TIMES A W))
(TIMES A B))
(NOT (ZEROP (TIMES A B))))
(NUMBERP V)
(NOT (EQUAL (TIMES A B) 0)))
(EQUAL W
(REMAINDER (QUOTIENT (PLUS (PLUS D (TIMES A W))
(TIMES (TIMES A B) V))
A)
B))),
which simplifies, applying LESSP-PLUS-TIMES2, EQUAL-TIMES-0, TIMES-ZERO,
COMMUTATIVITY-OF-TIMES, ASSOCIATIVITY-OF-TIMES, ASSOCIATIVITY-OF-PLUS,
REMAINDER-TIMES1-INSTANCE, QUOTIENT-TIMES-INSTANCE, QUOTIENT-LESSP-ARG1,
PLUS-ZERO-ARG2, QUOTIENT-PLUS, REMAINDER-NOOP, and REMAINDER-PLUS, and
expanding the functions ZEROP, NOT, EQUAL, and TIMES, to:
T.
Q.E.D.
[ 0.0 0.2 0.0 ]
QUOTIENT-REMAINDER-TIMES
(PROVE-LEMMA QUOTIENT-REMAINDER
(REWRITE)
(IMPLIES (EQUAL (REMAINDER C A) 0)
(EQUAL (QUOTIENT (REMAINDER B C) A)
(REMAINDER (QUOTIENT B A)
(QUOTIENT C A))))
((ENABLE QUOTIENT-NOOP QUOTIENT-PLUS QUOTIENT-REMAINDER-TIMES
QUOTIENT-TIMES-INSTANCE QUOTIENT-ZERO)
(DO-NOT-INDUCT T)))
.
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace B by (PLUS Z (TIMES A X))
to eliminate (QUOTIENT B A) and (REMAINDER B A) and X by:
(PLUS V (TIMES (QUOTIENT C A) W))
to eliminate (REMAINDER X (QUOTIENT C A)) and (QUOTIENT X (QUOTIENT C A)). 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 restrict the new variables. This produces the following six new
conjectures:
Case 6. (IMPLIES (AND (NOT (NUMBERP B))
(EQUAL (REMAINDER C A) 0))
(EQUAL (QUOTIENT (REMAINDER B C) A)
(REMAINDER (QUOTIENT B A)
(QUOTIENT C A)))).
But this simplifies, appealing to the lemmas REMAINDER-OF-NON-NUMBER,
QUOTIENT-OF-NON-NUMBER, and EQUAL-QUOTIENT-0, and unfolding the definitions
of LESSP, EQUAL, NUMBERP, REMAINDER, and QUOTIENT, to:
T.
Case 5. (IMPLIES (AND (EQUAL A 0)
(EQUAL (REMAINDER C A) 0))
(EQUAL (QUOTIENT (REMAINDER B C) A)
(REMAINDER (QUOTIENT B A)
(QUOTIENT C A)))),
which simplifies, applying REMAINDER-ZERO and QUOTIENT-ZERO, and unfolding
the functions ZEROP, QUOTIENT, REMAINDER, and EQUAL, to:
T.
Case 4. (IMPLIES (AND (NOT (NUMBERP A))
(EQUAL (REMAINDER C A) 0))
(EQUAL (QUOTIENT (REMAINDER B C) A)
(REMAINDER (QUOTIENT B A)
(QUOTIENT C A)))).
But this simplifies, rewriting with REMAINDER-ZERO and QUOTIENT-ZERO, and
opening up the functions ZEROP, REMAINDER, and EQUAL, to:
T.
Case 3. (IMPLIES (AND (EQUAL (QUOTIENT C A) 0)
(NUMBERP X)
(NUMBERP Z)
(EQUAL (LESSP Z A) (NOT (ZEROP A)))
(NUMBERP A)
(NOT (EQUAL A 0))
(EQUAL (REMAINDER C A) 0))
(EQUAL (QUOTIENT (REMAINDER (PLUS Z (TIMES A X)) C)
A)
(REMAINDER X (QUOTIENT C A)))).
This simplifies, appealing to the lemmas EQUAL-QUOTIENT-0, REMAINDER-NOOP,
REMAINDER-ZERO, REMAINDER-TIMES1-INSTANCE, QUOTIENT-TIMES-INSTANCE,
QUOTIENT-LESSP-ARG1, PLUS-ZERO-ARG2, and QUOTIENT-PLUS, and expanding the
definitions of ZEROP, NOT, and EQUAL, to:
T.
Case 2. (IMPLIES (AND (NOT (NUMBERP (QUOTIENT C A)))
(NUMBERP X)
(NUMBERP Z)
(EQUAL (LESSP Z A) (NOT (ZEROP A)))
(NUMBERP A)
(NOT (EQUAL A 0))
(EQUAL (REMAINDER C A) 0))
(EQUAL (QUOTIENT (REMAINDER (PLUS Z (TIMES A X)) C)
A)
(REMAINDER X (QUOTIENT C A)))),
which simplifies, obviously, to:
T.
Case 1. (IMPLIES
(AND (NUMBERP V)
(EQUAL (LESSP V (QUOTIENT C A))
(NOT (ZEROP (QUOTIENT C A))))
(NUMBERP W)
(NOT (EQUAL (QUOTIENT C A) 0))
(NUMBERP Z)
(EQUAL (LESSP Z A) (NOT (ZEROP A)))
(NUMBERP A)
(NOT (EQUAL A 0))
(EQUAL (REMAINDER C A) 0))
(EQUAL
(QUOTIENT (REMAINDER (PLUS Z
(TIMES A
(PLUS V (TIMES (QUOTIENT C A) W))))
C)
A)
V)).
This simplifies, applying EQUAL-QUOTIENT-0, COMMUTATIVITY-OF-TIMES,
TIMES-DISTRIBUTES-OVER-PLUS, and QUOTIENT-LESSP-ARG1, and opening up the
functions ZEROP, NOT, and EQUAL, to:
(IMPLIES (AND (NUMBERP V)
(NOT (LESSP C A))
(EQUAL (LESSP V (QUOTIENT C A)) T)
(NUMBERP W)
(NUMBERP Z)
(LESSP Z A)
(NUMBERP A)
(NOT (EQUAL A 0))
(EQUAL (REMAINDER C A) 0))
(EQUAL (QUOTIENT (REMAINDER (PLUS Z
(TIMES A V)
(TIMES A W (QUOTIENT C A)))
C)
A)
V)),
which again simplifies, obviously, to:
(IMPLIES (AND (NUMBERP V)
(NOT (LESSP C A))
(LESSP V (QUOTIENT C A))
(NUMBERP W)
(NUMBERP Z)
(LESSP Z A)
(NUMBERP A)
(NOT (EQUAL A 0))
(EQUAL (REMAINDER C A) 0))
(EQUAL (QUOTIENT (REMAINDER (PLUS Z
(TIMES A V)
(TIMES A W (QUOTIENT C A)))
C)
A)
V)).
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace C by
(PLUS D (TIMES A X)) to eliminate (QUOTIENT C A) and (REMAINDER C A). We
employ 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 two new conjectures:
Case 1.2.
(IMPLIES
(AND (NOT (NUMBERP C))
(NUMBERP V)
(NOT (LESSP C A))
(LESSP V (QUOTIENT C A))
(NUMBERP W)
(NUMBERP Z)
(LESSP Z A)
(NUMBERP A)
(NOT (EQUAL A 0))
(EQUAL (REMAINDER C A) 0))
(EQUAL (QUOTIENT (REMAINDER (PLUS Z
(TIMES A V)
(TIMES A W (QUOTIENT C A)))
C)
A)
V)).
This further simplifies, unfolding the definition of LESSP, to:
T.
Case 1.1.
(IMPLIES
(AND (NUMBERP X)
(NUMBERP D)
(EQUAL (LESSP D A) (NOT (ZEROP A)))
(NUMBERP V)
(NOT (LESSP (PLUS D (TIMES A X)) A))
(LESSP V X)
(NUMBERP W)
(NUMBERP Z)
(LESSP Z A)
(NUMBERP A)
(NOT (EQUAL A 0))
(EQUAL D 0))
(EQUAL (QUOTIENT (REMAINDER (PLUS Z (TIMES A V) (TIMES A W X))
(PLUS D (TIMES A X)))
A)
V)),
which further simplifies, using linear arithmetic, rewriting with
LESSP-TIMES2, REMAINDER-TIMES1-INSTANCE, REMAINDER-NOOP, REMAINDER-PLUS,
REMAINDER-PLUS-TIMES-TIMES-INSTANCE, QUOTIENT-TIMES-INSTANCE,
QUOTIENT-LESSP-ARG1, PLUS-ZERO-ARG2, and QUOTIENT-PLUS, and unfolding the
definitions of NUMBERP, EQUAL, LESSP, ZEROP, NOT, and PLUS, to:
T.
Q.E.D.
[ 0.0 3.7 0.0 ]
QUOTIENT-REMAINDER
(PROVE-LEMMA QUOTIENT-REMAINDER-INSTANCE
(REWRITE)
(EQUAL (QUOTIENT (REMAINDER X (TIMES A B)) A)
(REMAINDER (QUOTIENT X A) B))
((ENABLE QUOTIENT-REMAINDER QUOTIENT-TIMES-INSTANCE
REMAINDER-TIMES1-INSTANCE)
(DO-NOT-INDUCT T)))
WARNING: the previously added lemma, QUOTIENT-REMAINDER-TIMES, could be
applied whenever the newly proposed QUOTIENT-REMAINDER-INSTANCE could!
This conjecture can be simplified, using the abbreviation
QUOTIENT-REMAINDER-TIMES, to the goal:
(EQUAL (REMAINDER (QUOTIENT X A) B)
(REMAINDER (QUOTIENT X A) B)).
This simplifies, clearly, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-REMAINDER-INSTANCE
(PROVE-LEMMA QUOTIENT-PLUS-FACT NIL
(IMPLIES (AND (EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP A X))
(EQUAL (QUOTIENT (PLUS A B) C)
(QUOTIENT B C)))
((ENABLE QUOTIENT-LESSP-ARG1 LESSP-PLUS-FACT)
(INDUCT (QUOTIENT B 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 B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP A X))
(EQUAL (QUOTIENT (PLUS A B) C)
(QUOTIENT B C))).
This simplifies, using linear arithmetic, rewriting with the lemmas
REMAINDER-NOOP, QUOTIENT-ZERO, and REMAINDER-OF-NON-NUMBER, and unfolding
the functions ZEROP, NUMBERP, and EQUAL, 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 (QUOTIENT (PLUS A B) C)
(QUOTIENT B C))).
This simplifies, applying LESSP-PLUS-FACT and QUOTIENT-LESSP-ARG1, and
unfolding EQUAL, 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 (QUOTIENT (PLUS A (DIFFERENCE B C)) C)
(QUOTIENT (DIFFERENCE B C) C)))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP A X))
(EQUAL (QUOTIENT (PLUS A B) C)
(QUOTIENT B C))),
which simplifies, using linear arithmetic, appealing to the lemmas
REMAINDER-DIFFERENCE1, PLUS-ZERO-ARG2, PLUS-DIFFERENCE-ARG2,
DIFFERENCE-LEQ-ARG1, REMAINDER-NOOP, QUOTIENT-LESSP-ARG1, PLUS-ADD1-ARG1,
QUOTIENT-PLUS, EQUAL-QUOTIENT-0, and ADD1-EQUAL, and opening up the
definitions of EQUAL, DIFFERENCE, AND, ZEROP, IMPLIES, REMAINDER, NUMBERP,
ADD1, QUOTIENT, PLUS, and LESSP, to 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 (QUOTIENT A C)
(QUOTIENT (DIFFERENCE B C) C))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP A X))
(LESSP A C)),
which again simplifies, using linear arithmetic, to two new goals:
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)
(QUOTIENT (DIFFERENCE B C) C))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP A X))
(LESSP A C)),
which again simplifies, unfolding the definition of 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)
(QUOTIENT (DIFFERENCE B B) B))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER B X) 0)
(LESSP A X))
(LESSP A B)),
which again simplifies, using linear arithmetic and applying the lemmas
DIFFERENCE-X-X, QUOTIENT-LESSP-ARG1, and EQUAL-QUOTIENT-0, 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)
(QUOTIENT (DIFFERENCE B C) C))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(NOT (EQUAL X 0))
(NUMBERP X)
(NOT (NUMBERP B)))
(EQUAL (QUOTIENT 0 C) 1)),
which again simplifies, expanding the function 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)
(QUOTIENT (DIFFERENCE B C) C))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(NOT (EQUAL X 0))
(NUMBERP X)
(NUMBERP B))
(EQUAL (QUOTIENT B C) 1)),
which again simplifies, using linear arithmetic, to the conjecture:
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (LESSP B B))
(NOT (LESSP B B))
(NOT (NUMBERP A))
(EQUAL (QUOTIENT 0 B)
(QUOTIENT (DIFFERENCE B B) B))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER B X) 0)
(NOT (EQUAL X 0))
(NUMBERP X)
(NUMBERP B))
(EQUAL (QUOTIENT B B) 1)).
However this again simplifies, rewriting with QUOTIENT-LESSP-ARG1 and
DIFFERENCE-X-X, and unfolding the definitions of LESSP, EQUAL, ADD1, and
QUOTIENT, 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)
(QUOTIENT (DIFFERENCE B C) C))
(EQUAL (REMAINDER B X) 0)
(EQUAL (REMAINDER C X) 0)
(LESSP A X)
(LESSP (PLUS A B) C))
(EQUAL 0
(ADD1 (QUOTIENT (DIFFERENCE B C) C)))).
But this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.7 0.0 ]
QUOTIENT-PLUS-FACT
(PROVE-LEMMA QUOTIENT-PLUS-TIMES-TIMES-PROOF NIL
(IMPLIES (LESSP A B)
(EQUAL (QUOTIENT (PLUS A (TIMES B C))
(TIMES B D))
(QUOTIENT (TIMES B C) (TIMES B D))))
((USE (QUOTIENT-PLUS-FACT (A A)
(X B)
(B (TIMES B C))
(C (TIMES B D))))
(ENABLE REMAINDER-TIMES1-INSTANCE)
(DO-NOT-INDUCT T)))
This conjecture can be simplified, using the abbreviations IMPLIES and
REMAINDER-TIMES1-INSTANCE, to the conjecture:
(IMPLIES (AND (IMPLIES (AND (EQUAL 0 0)
(EQUAL 0 0)
(LESSP A B))
(EQUAL (QUOTIENT (PLUS A (TIMES B C))
(TIMES B D))
(QUOTIENT (TIMES B C) (TIMES B D))))
(LESSP A B))
(EQUAL (QUOTIENT (PLUS A (TIMES B C))
(TIMES B D))
(QUOTIENT (TIMES B C) (TIMES B D)))).
This simplifies, opening up the definitions of EQUAL, AND, and IMPLIES, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
QUOTIENT-PLUS-TIMES-TIMES-PROOF
(PROVE-LEMMA QUOTIENT-PLUS-TIMES-TIMES
(REWRITE)
(IMPLIES (LESSP A B)
(AND (EQUAL (QUOTIENT (PLUS A (TIMES B C))
(TIMES B D))
(QUOTIENT (TIMES B C) (TIMES B D)))
(EQUAL (QUOTIENT (PLUS A (TIMES B C))
(TIMES B D))
(QUOTIENT (TIMES B C) (TIMES B D)))))
((USE (QUOTIENT-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 QUOTIENT-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, unfolding IMPLIES and AND, to:
T.
Q.E.D.
[ 0.0 0.8 0.0 ]
QUOTIENT-PLUS-TIMES-TIMES
(PROVE-LEMMA QUOTIENT-PLUS-TIMES-TIMES-INSTANCE
(REWRITE)
(IMPLIES (LESSP A B)
(AND (EQUAL (QUOTIENT (PLUS A (TIMES B C) (TIMES B D))
(TIMES B E))
(IF (ZEROP B)
0
(QUOTIENT (PLUS C D) E)))
(EQUAL (QUOTIENT (PLUS A (TIMES C B) (TIMES D B))
(TIMES E B))
(IF (ZEROP B)
0
(QUOTIENT (PLUS D C) E)))))
((DISABLE TIMES-DISTRIBUTES-OVER-PLUS)
(ENABLE QUOTIENT-TIMES-TIMES)
(USE (TIMES-DISTRIBUTES-OVER-PLUS (X B)
(Y C)
(Z D)))
(DO-NOT-INDUCT T)))
WARNING: Note that the proposed lemma QUOTIENT-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 simplifies, rewriting with COMMUTATIVITY-OF-TIMES, QUOTIENT-TIMES-TIMES,
QUOTIENT-PLUS-TIMES-TIMES, and COMMUTATIVITY-OF-PLUS, and opening up ZEROP and
AND, to:
T.
Q.E.D.
[ 0.0 0.2 0.0 ]
QUOTIENT-PLUS-TIMES-TIMES-INSTANCE
(PROVE-LEMMA QUOTIENT-QUOTIENT
(REWRITE)
(EQUAL (QUOTIENT (QUOTIENT B A) C)
(QUOTIENT B (TIMES A C)))
((DISABLE TIMES-DISTRIBUTES-OVER-PLUS)
(ENABLE QUOTIENT-LESSP-ARG1 QUOTIENT-PLUS
QUOTIENT-PLUS-TIMES-TIMES QUOTIENT-TIMES-INSTANCE
QUOTIENT-TIMES-TIMES QUOTIENT-NOOP QUOTIENT-ZERO)
(DO-NOT-INDUCT T)))
.
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace B by (PLUS Z (TIMES A X))
to eliminate (QUOTIENT B A) and (REMAINDER B A) and X by (PLUS W (TIMES C V))
to eliminate (QUOTIENT X C) and (REMAINDER X C). We rely upon 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 thus obtain the following six new conjectures:
Case 6. (IMPLIES (NOT (NUMBERP B))
(EQUAL (QUOTIENT (QUOTIENT B A) C)
(QUOTIENT B (TIMES A C)))).
But this simplifies, applying the lemmas QUOTIENT-OF-NON-NUMBER and
EQUAL-TIMES-0, and opening up the definitions of LESSP, EQUAL, and QUOTIENT,
to:
T.
Case 5. (IMPLIES (EQUAL A 0)
(EQUAL (QUOTIENT (QUOTIENT B A) C)
(QUOTIENT B (TIMES A C)))),
which simplifies, rewriting with QUOTIENT-ZERO, and opening up the functions
ZEROP, LESSP, EQUAL, QUOTIENT, and TIMES, to:
T.
Case 4. (IMPLIES (NOT (NUMBERP A))
(EQUAL (QUOTIENT (QUOTIENT B A) C)
(QUOTIENT B (TIMES A C)))).
But this simplifies, rewriting with QUOTIENT-ZERO, and opening up the
functions ZEROP, LESSP, EQUAL, QUOTIENT, and TIMES, to:
T.
Case 3. (IMPLIES (AND (EQUAL C 0)
(NUMBERP X)
(NUMBERP Z)
(EQUAL (LESSP Z A) (NOT (ZEROP A)))
(NUMBERP A)
(NOT (EQUAL A 0)))
(EQUAL (QUOTIENT X C)
(QUOTIENT (PLUS Z (TIMES A X))
(TIMES A C)))).
But this simplifies, applying QUOTIENT-ZERO and COMMUTATIVITY-OF-TIMES, and
opening up the functions ZEROP, NOT, EQUAL, and TIMES, to:
T.
Case 2. (IMPLIES (AND (NOT (NUMBERP C))
(NUMBERP X)
(NUMBERP Z)
(EQUAL (LESSP Z A) (NOT (ZEROP A)))
(NUMBERP A)
(NOT (EQUAL A 0)))
(EQUAL (QUOTIENT X C)
(QUOTIENT (PLUS Z (TIMES A X))
(TIMES A C)))).
But this simplifies, applying QUOTIENT-ZERO and TIMES-ZERO, and expanding
the functions ZEROP, NOT, and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NUMBERP V)
(NUMBERP W)
(EQUAL (LESSP W C) (NOT (ZEROP C)))
(NUMBERP C)
(NOT (EQUAL C 0))
(NUMBERP Z)
(EQUAL (LESSP Z A) (NOT (ZEROP A)))
(NUMBERP A)
(NOT (EQUAL A 0)))
(EQUAL V
(QUOTIENT (PLUS Z
(TIMES A (PLUS W (TIMES C V))))
(TIMES A C)))).
This simplifies, applying REMAINDER-TIMES1-INSTANCE, QUOTIENT-TIMES-INSTANCE,
QUOTIENT-LESSP-ARG1, PLUS-ZERO-ARG2, QUOTIENT-PLUS, QUOTIENT-TIMES-TIMES,
and QUOTIENT-PLUS-TIMES-TIMES, and unfolding the definitions of ZEROP, NOT,
and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
QUOTIENT-QUOTIENT
(PROVE-LEMMA LEQ-QUOTIENT NIL
(IMPLIES (LESSP A B)
(LEQ (QUOTIENT A C) (QUOTIENT B C)))
((INDUCT (DOUBLE-REMAINDER-INDUCTION A B C))
(ENABLE QUOTIENT-LESSP-ARG1 QUOTIENT-ZERO)))
This formula can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to the following four new formulas:
Case 4. (IMPLIES (AND (ZEROP C) (LESSP A B))
(NOT (LESSP (QUOTIENT B C)
(QUOTIENT A C)))).
This simplifies, applying QUOTIENT-ZERO, and expanding ZEROP and LESSP, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(LESSP A C)
(LESSP A B))
(NOT (LESSP (QUOTIENT B C)
(QUOTIENT A C)))),
which simplifies, rewriting with QUOTIENT-LESSP-ARG1, and unfolding the
definitions of EQUAL and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(LESSP B C)
(LESSP A B))
(NOT (LESSP (QUOTIENT B C)
(QUOTIENT A C)))).
This 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 (LESSP (DIFFERENCE A C)
(DIFFERENCE B C))
(IF (LESSP (QUOTIENT (DIFFERENCE B C) C)
(QUOTIENT (DIFFERENCE A C) C))
F T))
(LESSP A B))
(NOT (LESSP (QUOTIENT B C)
(QUOTIENT A C)))).
This simplifies, applying SUB1-ADD1, and expanding the functions IMPLIES,
QUOTIENT, and LESSP, to:
(IMPLIES (AND (NOT (EQUAL C 0))
(NUMBERP C)
(NOT (LESSP A C))
(NOT (LESSP B C))
(NOT (LESSP (DIFFERENCE A C)
(DIFFERENCE B C)))
(LESSP A B))
(NOT (LESSP (QUOTIENT (DIFFERENCE B C) C)
(QUOTIENT (DIFFERENCE A C) C)))).
But this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.9 0.0 ]
LEQ-QUOTIENT
(PROVE-LEMMA QUOTIENT-1-ARG2
(REWRITE)
(EQUAL (QUOTIENT N 1) (FIX N)))
This simplifies, rewriting with QUOTIENT-NOOP, and unfolding EQUAL and FIX, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-1-ARG2
(PROVE-LEMMA QUOTIENT-1-ARG1-CASESPLIT NIL
(OR (ZEROP N)
(EQUAL N 1)
(LESSP 1 N)))
This conjecture can be simplified, using the abbreviations ZEROP and OR, to
the goal:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL N 1)))
(LESSP 1 N)).
This simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-1-ARG1-CASESPLIT
(PROVE-LEMMA QUOTIENT-1-ARG1
(REWRITE)
(EQUAL (QUOTIENT 1 N)
(IF (EQUAL N 1) 1 0))
((ENABLE QUOTIENT-LESSP-ARG1)
(USE (QUOTIENT-1-ARG1-CASESPLIT))))
This formula simplifies, applying REMAINDER-ZERO, QUOTIENT-ZERO, QUOTIENT-ADD1,
and QUOTIENT-LESSP-ARG1, and expanding the functions ZEROP, OR, QUOTIENT,
EQUAL, and NUMBERP, to the formula:
(IMPLIES (LESSP 1 N)
(NOT (EQUAL N 1))).
But this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-1-ARG1
(PROVE-LEMMA QUOTIENT-X-X
(REWRITE)
(IMPLIES (NOT (ZEROP X))
(EQUAL (QUOTIENT X X) 1))
((ENABLE DIFFERENCE-X-X)))
This formula can be simplified, using the abbreviations ZEROP, NOT, and
IMPLIES, to:
(IMPLIES (AND (NOT (EQUAL X 0)) (NUMBERP X))
(EQUAL (QUOTIENT X X) 1)),
which simplifies, using linear arithmetic, rewriting with the lemmas
QUOTIENT-LESSP-ARG1 and DIFFERENCE-X-X, and expanding the functions ADD1 and
QUOTIENT, to the goal:
(IMPLIES (AND (NOT (EQUAL X 0)) (NUMBERP X))
(NOT (LESSP X X))).
But this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-X-X
(PROVE-LEMMA LESSP-QUOTIENT
(REWRITE)
(EQUAL (LESSP (QUOTIENT I J) I)
(AND (NOT (ZEROP I))
(NOT (EQUAL J 1)))))
This formula simplifies, opening up ZEROP, NOT, and AND, to the following four
new formulas:
Case 4. (IMPLIES (EQUAL I 0)
(EQUAL (LESSP (QUOTIENT I J) I) F)).
This again simplifies, opening up the functions LESSP, EQUAL, and QUOTIENT,
to:
T.
Case 3. (IMPLIES (NOT (NUMBERP I))
(EQUAL (LESSP (QUOTIENT I J) I) F)),
which again simplifies, rewriting with QUOTIENT-OF-NON-NUMBER, and opening
up the functions LESSP, EQUAL, and QUOTIENT, to:
T.
Case 2. (IMPLIES (EQUAL J 1)
(EQUAL (LESSP (QUOTIENT I J) I) F)).
This again simplifies, appealing to the lemma QUOTIENT-1-ARG2, to two new
conjectures:
Case 2.2.
(IMPLIES (NOT (NUMBERP I))
(NOT (LESSP 0 I))),
which again simplifies, unfolding the definition of LESSP, to:
T.
Case 2.1.
(IMPLIES (NUMBERP I)
(NOT (LESSP I I))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL J 1)))
(EQUAL (LESSP (QUOTIENT I J) I) T)),
which again simplifies, trivially, to:
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL J 1)))
(LESSP (QUOTIENT I J) I)).
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace I by
(PLUS Z (TIMES J X)) to eliminate (QUOTIENT I J) and (REMAINDER I J). We
employ 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 thus obtain the following
three new formulas:
Case 1.3.
(IMPLIES (AND (EQUAL J 0)
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL J 1)))
(LESSP (QUOTIENT I J) I)).
This further simplifies, applying QUOTIENT-ZERO, and opening up the
definitions of EQUAL, ZEROP, and LESSP, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (NUMBERP J))
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL J 1)))
(LESSP (QUOTIENT I J) I)).
However this further simplifies, applying QUOTIENT-ZERO, and expanding
ZEROP, EQUAL, and LESSP, to:
T.
Case 1.1.
(IMPLIES (AND (NUMBERP X)
(NUMBERP Z)
(EQUAL (LESSP Z J) (NOT (ZEROP J)))
(NUMBERP J)
(NOT (EQUAL J 0))
(NOT (EQUAL (PLUS Z (TIMES J X)) 0))
(NOT (EQUAL J 1)))
(LESSP X (PLUS Z (TIMES J X)))).
This further simplifies, applying EQUAL-TIMES-0 and EQUAL-PLUS-0, and
opening up ZEROP and NOT, to the following two new conjectures:
Case 1.1.2.
(IMPLIES (AND (NUMBERP X)
(NUMBERP Z)
(LESSP Z J)
(NUMBERP J)
(NOT (EQUAL J 0))
(NOT (EQUAL Z 0))
(NOT (EQUAL J 1)))
(LESSP X (PLUS Z (TIMES J X)))),
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 (QUOTIENT I J) I)
(AND (NOT (ZEROP I))
(NOT (EQUAL J 1)))),
which we named *1 above. We will appeal to induction. The recursive terms in
the conjecture suggest two 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 (ZEROP J) (p I J))
(IMPLIES (AND (NOT (ZEROP J)) (LESSP I J))
(p I J))
(IMPLIES (AND (NOT (ZEROP J))
(NOT (LESSP I J))
(p (DIFFERENCE I J) J))
(p I J))).
Linear arithmetic, the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP, and the
definition of ZEROP can be used to prove that the measure (COUNT I) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme generates three new goals:
Case 3. (IMPLIES (ZEROP J)
(EQUAL (LESSP (QUOTIENT I J) I)
(AND (NOT (ZEROP I))
(NOT (EQUAL J 1))))),
which simplifies, applying the lemma QUOTIENT-ZERO, and unfolding the
definitions of ZEROP, EQUAL, LESSP, NOT, and AND, to four new formulas:
Case 3.4.
(IMPLIES (AND (EQUAL J 0)
(NOT (EQUAL I 0))
(NOT (NUMBERP I)))
(EQUAL (NUMBERP I) F)),
which again simplifies, trivially, to:
T.
Case 3.3.
(IMPLIES (AND (EQUAL J 0)
(NOT (EQUAL I 0))
(NUMBERP I))
(EQUAL (NUMBERP I) T)).
This again simplifies, clearly, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP J))
(NOT (EQUAL I 0))
(NOT (NUMBERP I)))
(EQUAL (NUMBERP I) F)).
This again simplifies, obviously, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (NUMBERP J))
(NOT (EQUAL I 0))
(NUMBERP I))
(EQUAL (NUMBERP I) T)).
This again simplifies, trivially, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP J)) (LESSP I J))
(EQUAL (LESSP (QUOTIENT I J) I)
(AND (NOT (ZEROP I))
(NOT (EQUAL J 1))))).
This simplifies, appealing to the lemma QUOTIENT-LESSP-ARG1, and expanding
the functions ZEROP, EQUAL, LESSP, NOT, and AND, to the following three new
goals:
Case 2.3.
(IMPLIES (AND (NOT (EQUAL J 0))
(NUMBERP J)
(LESSP I J)
(NOT (EQUAL I 0))
(EQUAL J 1))
(EQUAL (NUMBERP I) F)).
This again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (EQUAL 1 0))
(NUMBERP 1)
(LESSP I 1)
(NOT (EQUAL I 0)))
(EQUAL (NUMBERP I) F)).
This again simplifies, trivially, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL J 0))
(NUMBERP J)
(LESSP I J)
(NOT (EQUAL I 0))
(NOT (NUMBERP I)))
(EQUAL (NUMBERP I) F)).
This again simplifies, trivially, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL J 0))
(NUMBERP J)
(LESSP I J)
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL J 1)))
(EQUAL (NUMBERP I) T)).
This again simplifies, clearly, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP J))
(NOT (LESSP I J))
(EQUAL (LESSP (QUOTIENT (DIFFERENCE I J) J)
(DIFFERENCE I J))
(AND (NOT (ZEROP (DIFFERENCE I J)))
(NOT (EQUAL J 1)))))
(EQUAL (LESSP (QUOTIENT I J) I)
(AND (NOT (ZEROP I))
(NOT (EQUAL J 1))))).
This simplifies, applying EQUAL-DIFFERENCE-0, QUOTIENT-1-ARG2, and SUB1-ADD1,
and opening up ZEROP, NOT, AND, EQUAL, QUOTIENT, and LESSP, to five new
conjectures:
Case 1.5.
(IMPLIES (AND (NOT (EQUAL J 0))
(NUMBERP J)
(NOT (LESSP I J))
(EQUAL J 1)
(EQUAL (LESSP (QUOTIENT (DIFFERENCE I J) J)
(DIFFERENCE I J))
F)
(NOT (NUMBERP I)))
(NOT (LESSP 0 I))),
which again simplifies, expanding the definitions of EQUAL, NUMBERP, and
LESSP, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL J 0))
(NUMBERP J)
(NOT (LESSP I J))
(EQUAL J 1)
(EQUAL (LESSP (QUOTIENT (DIFFERENCE I J) J)
(DIFFERENCE I J))
F)
(NUMBERP I))
(NOT (LESSP I I))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL J 0))
(NUMBERP J)
(NOT (LESSP I J))
(NOT (LESSP J I))
(EQUAL (LESSP (QUOTIENT (DIFFERENCE I J) J)
(DIFFERENCE I J))
F)
(NOT (EQUAL I 0))
(NUMBERP I)
(EQUAL J 1))
(EQUAL (LESSP (QUOTIENT (DIFFERENCE I J) J)
(SUB1 I))
F)),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (EQUAL 1 0))
(NUMBERP 1)
(NOT (LESSP 1 1))
(NOT (LESSP 1 1))
(EQUAL (LESSP (QUOTIENT (DIFFERENCE 1 1) 1)
(DIFFERENCE 1 1))
F)
(NOT (EQUAL 1 0))
(NUMBERP 1))
(EQUAL (LESSP (QUOTIENT (DIFFERENCE 1 1) 1)
(SUB1 1))
F)).
However this again simplifies, expanding EQUAL, NUMBERP, LESSP, DIFFERENCE,
QUOTIENT, and SUB1, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL J 0))
(NUMBERP J)
(NOT (LESSP I J))
(NOT (LESSP J I))
(EQUAL (LESSP (QUOTIENT (DIFFERENCE I J) J)
(DIFFERENCE I J))
F)
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL J 1)))
(EQUAL (LESSP (QUOTIENT (DIFFERENCE I J) J)
(SUB1 I))
T)),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(NOT (LESSP I I))
(NOT (LESSP I I))
(EQUAL (LESSP (QUOTIENT (DIFFERENCE I I) I)
(DIFFERENCE I I))
F)
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL I 1)))
(EQUAL (LESSP (QUOTIENT (DIFFERENCE I I) I)
(SUB1 I))
T)).
But this again simplifies, applying the lemmas DIFFERENCE-X-X,
QUOTIENT-LESSP-ARG1, and EQUAL-SUB1-0, and unfolding the functions LESSP
and EQUAL, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL J 0))
(NUMBERP J)
(NOT (LESSP I J))
(LESSP J I)
(NOT (EQUAL J 1))
(EQUAL (LESSP (QUOTIENT (DIFFERENCE I J) J)
(DIFFERENCE I J))
T)
(NOT (EQUAL I 0))
(NUMBERP I))
(EQUAL (LESSP (QUOTIENT (DIFFERENCE I J) J)
(SUB1 I))
T)),
which again simplifies, obviously, to:
(IMPLIES (AND (NOT (EQUAL J 0))
(NUMBERP J)
(NOT (LESSP I J))
(LESSP J I)
(NOT (EQUAL J 1))
(LESSP (QUOTIENT (DIFFERENCE I J) J)
(DIFFERENCE I J))
(NOT (EQUAL I 0))
(NUMBERP I))
(LESSP (QUOTIENT (DIFFERENCE I J) J)
(SUB1 I))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
LESSP-QUOTIENT
(DEFN CANCEL-QUOTIENT-TIMES
(X)
(IF (AND (EQUAL (CAR X) 'QUOTIENT)
(EQUAL (CAADR X) 'TIMES)
(EQUAL (CAADDR X) 'TIMES))
(IF (LISTP (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
(LIST 'IF
(AND-NOT-ZEROP-TREE (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
(LIST 'QUOTIENT
(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))))))
'(ZERO))
X)
X))
Observe that:
(OR (LISTP (CANCEL-QUOTIENT-TIMES X))
(EQUAL (CANCEL-QUOTIENT-TIMES X) X))
is a theorem.
[ 0.0 0.0 0.0 ]
CANCEL-QUOTIENT-TIMES
(PROVE-LEMMA ZEROP-MAKES-QUOTIENT-ZERO-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 (QUOTIENT (TIMES (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A))
(TIMES (EVAL$ T (CADR Y) A)
(EVAL$ T (CADDR Y) A)))
0))
((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))))
(ENABLE AND-NOT-ZEROP-TREE BAGINT DELETE EQUAL-QUOTIENT-0
EQUAL-TIMES-0 EVAL$-TIMES SUBBAGP-BAGINT1 SUBBAGP-BAGINT2
TIMES-FRINGE TIMES-TREE TIMES-TREE-APPEND
TIMES-TREE-OF-TIMES-FRINGE ZEROP-MAKES-LESSP-FALSE-BRIDGE)))
This formula can be simplified, using the abbreviations EQUAL-TIMES-0,
EQUAL-QUOTIENT-0, NOT, IMPLIES, and AND, to:
(IMPLIES
(AND
(IMPLIES
(AND (NOT (EVAL$ T
(AND-NOT-ZEROP-TREE (BAGINT (TIMES-FRINGE X)
(TIMES-FRINGE Y)))
A))
(SUBBAGP (BAGINT (TIMES-FRINGE X)
(TIMES-FRINGE Y))
(TIMES-FRINGE X)))
(EQUAL (EVAL$ T
(TIMES-TREE (TIMES-FRINGE X))
A)
0))
(IMPLIES
(AND (NOT (EVAL$ T
(AND-NOT-ZEROP-TREE (BAGINT (TIMES-FRINGE X)
(TIMES-FRINGE Y)))
A))
(SUBBAGP (BAGINT (TIMES-FRINGE X)
(TIMES-FRINGE Y))
(TIMES-FRINGE Y)))
(EQUAL (EVAL$ T
(TIMES-TREE (TIMES-FRINGE Y))
A)
0))
(EQUAL (CAR X) 'TIMES)
(EQUAL (CAR Y) 'TIMES)
(NOT (EVAL$ T
(AND-NOT-ZEROP-TREE (BAGINT (TIMES-FRINGE X)
(TIMES-FRINGE Y)))
A))
(NOT (EQUAL (EVAL$ T (CADR Y) A) 0))
(NUMBERP (EVAL$ T (CADR Y) A))
(NOT (EQUAL (EVAL$ T (CADDR Y) A) 0))
(NUMBERP (EVAL$ T (CADDR Y) A))
(NUMBERP (TIMES (EVAL$ T (CADR Y) A)
(EVAL$ T (CADDR Y) A))))
(LESSP (TIMES (EVAL$ T (CADR X) A)
(EVAL$ T (CADDR X) A))
(TIMES (EVAL$ T (CADR Y) A)
(EVAL$ T (CADDR Y) A)))),
which simplifies, rewriting with SUBBAGP-BAGINT1, CDR-CONS, MEMBER-NON-LIST,
CAR-CONS, REWRITE-EVAL$, CDR-NLISTP, EVAL$-TIMES, CAR-NLISTP, SUBBAGP-BAGINT2,
TIMES-TREE-OF-TIMES-FRINGE, TIMES-TREE-APPEND, EQUAL-TIMES-0, and
ZEROP-MAKES-LESSP-FALSE-BRIDGE, and expanding the definitions of EQUAL,
TIMES-FRINGE, NOT, AND, IMPLIES, BAGINT, DELETE, MEMBER, LISTP, 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 (EQUAL (EVAL$ T (CADR Y) A) 0))
(NUMBERP (EVAL$ T (CADR Y) A))
(NOT (EQUAL (EVAL$ T (CADDR Y) A) 0)))
(NOT (NUMBERP (EVAL$ T (CADDR Y) A)))),
which again simplifies, applying the lemmas TIMES-TREE-OF-TIMES-FRINGE,
TIMES-TREE-APPEND, and EQUAL-TIMES-0, to:
T.
Q.E.D.
[ 0.0 0.7 0.0 ]
ZEROP-MAKES-QUOTIENT-ZERO-BRIDGE
(DISABLE ZEROP-MAKES-QUOTIENT-ZERO-BRIDGE)
[ 0.0 0.0 0.0 ]
ZEROP-MAKES-QUOTIENT-ZERO-BRIDGE-OFF
(PROVE-LEMMA EVAL$-QUOTIENT-TIMES-TREE-BAGDIFF
(REWRITE)
(IMPLIES (AND (SUBBAGP X Y)
(SUBBAGP X Z)
(EVAL$ T (AND-NOT-ZEROP-TREE X) A))
(EQUAL (QUOTIENT (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(QUOTIENT (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A))))
((ENABLE AND-NOT-ZEROP-TREE BAGDIFF EQUAL-QUOTIENT-0
EVAL$-TIMES-MEMBER NUMBERP-EVAL$-TIMES-TREE
QUOTIENT-TIMES-TIMES 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 (QUOTIENT (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(QUOTIENT (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 (QUOTIENT (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(QUOTIENT (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 (QUOTIENT (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(QUOTIENT (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))),
which simplifies, rewriting with ZEROP-MAKES-TIMES-TREE-ZERO, SUBBAGP-CDR1,
NUMBERP-EVAL$-TIMES-TREE, and EQUAL-QUOTIENT-0, and unfolding SUBBAGP,
AND-NOT-ZEROP-TREE, BAGDIFF, QUOTIENT, 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 (EQUAL (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A)
0)))
(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
(QUOTIENT (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A))
(QUOTIENT (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 (QUOTIENT (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(QUOTIENT (EVAL$ T (TIMES-TREE Y) A)
(EVAL$ T (TIMES-TREE Z) A)))).
This simplifies, applying EVAL$-TIMES-MEMBER and QUOTIENT-TIMES-TIMES, 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
(QUOTIENT (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A))
(QUOTIENT (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 (QUOTIENT (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A))
0)),
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
(QUOTIENT (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A))
(QUOTIENT (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 (QUOTIENT (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A))
0)).
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
(QUOTIENT (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A))
(QUOTIENT (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 (QUOTIENT (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A))
0)).
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
(QUOTIENT (EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Y) (CDR X)))
A)
(EVAL$ T
(TIMES-TREE (BAGDIFF (DELETE (CAR X) Z) (CDR X)))
A))
(QUOTIENT (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 (QUOTIENT (EVAL$ T
(TIMES-TREE (DELETE (CAR X) Y))
A)
(EVAL$ T
(TIMES-TREE (DELETE (CAR X) Z))
A))
0)),
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 (QUOTIENT (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(QUOTIENT (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 (QUOTIENT (EVAL$ T (TIMES-TREE (BAGDIFF Y X)) A)
(EVAL$ T
(TIMES-TREE (BAGDIFF Z X))
A))
(QUOTIENT (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 0.4 0.0 ]
EVAL$-QUOTIENT-TIMES-TREE-BAGDIFF
(DISABLE EVAL$-QUOTIENT-TIMES-TREE-BAGDIFF)
[ 0.0 0.0 0.0 ]
EVAL$-QUOTIENT-TIMES-TREE-BAGDIFF-OFF
(PROVE-LEMMA CORRECTNESS-OF-CANCEL-QUOTIENT-TIMES
((META QUOTIENT))
(EQUAL (EVAL$ T X A)
(EVAL$ T (CANCEL-QUOTIENT-TIMES X) A))
((ENABLE CANCEL-QUOTIENT-TIMES EVAL$-QUOTIENT-TIMES-TREE-BAGDIFF
EVAL$-QUOTIENT EVAL$-TIMES SUBBAGP-BAGINT1
SUBBAGP-BAGINT2 TIMES-TREE-OF-TIMES-FRINGE
ZEROP-MAKES-QUOTIENT-ZERO-BRIDGE)))
This formula simplifies, opening up the function CANCEL-QUOTIENT-TIMES, to:
(IMPLIES
(AND (EQUAL (CAR X) 'QUOTIENT)
(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
(CONS 'IF
(CONS
(AND-NOT-ZEROP-TREE (BAGINT (TIMES-FRINGE (CADR X))
(TIMES-FRINGE (CADDR X))))
(CONS
(LIST 'QUOTIENT
(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))))))
'((ZERO)))))
A))),
which again simplifies, rewriting with EVAL$-TIMES, EVAL$-QUOTIENT,
REWRITE-EVAL$, CAR-CONS, CDR-CONS, SUBBAGP-BAGINT2, SUBBAGP-BAGINT1,
TIMES-TREE-OF-TIMES-FRINGE, and EVAL$-QUOTIENT-TIMES-TREE-BAGDIFF, and opening
up CAR, to the new formula:
(IMPLIES
(AND (EQUAL (CAR X) 'QUOTIENT)
(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 (QUOTIENT (TIMES (EVAL$ T (CADADR X) A)
(EVAL$ T (CADDADR X) A))
(TIMES (EVAL$ T (CADADDR X) A)
(EVAL$ T (CADDADDR X) A)))
0)),
which again simplifies, applying ZEROP-MAKES-QUOTIENT-ZERO-BRIDGE, and
unfolding the definition of EQUAL, to:
T.
Q.E.D.
[ 0.0 0.8 0.0 ]
CORRECTNESS-OF-CANCEL-QUOTIENT-TIMES
(DEFN EXP
(I J)
(IF (ZEROP J)
1
(TIMES I (EXP I (SUB1 J)))))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
inform us that the measure (COUNT J) decreases according to the well-founded
relation LESSP in each recursive call. Hence, EXP is accepted under the
definitional principle. From the definition we can conclude that
(NUMBERP (EXP I J)) is a theorem.
[ 0.0 0.0 0.0 ]
EXP
(DEFN LOG
(BASE N)
(IF (LESSP BASE 2)
0
(IF (ZEROP N)
0
(ADD1 (LOG BASE (QUOTIENT N BASE))))))
Linear arithmetic, the lemmas LESSP-QUOTIENT and COUNT-NUMBERP, and the
definition of ZEROP inform us that the measure (COUNT N) decreases according
to the well-founded relation LESSP in each recursive call. Hence, LOG is
accepted under the principle of definition. Note that (NUMBERP (LOG BASE N))
is a theorem.
[ 0.0 0.0 0.0 ]
LOG
(DEFN GCD
(X Y)
(IF (ZEROP X)
(FIX Y)
(IF (ZEROP Y)
X
(IF (LESSP X Y)
(GCD X (DIFFERENCE Y X))
(GCD (DIFFERENCE X Y) Y))))
((ORD-LESSP (CONS (ADD1 X) (FIX Y)))))
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, SUB1-ADD1, and
ADD1-EQUAL, and the definitions of ORDINALP, FIX, LESSP, ORD-LESSP, and ZEROP
establish that the measure (CONS (ADD1 X) (FIX Y)) decreases according to the
well-founded relation ORD-LESSP in each recursive call. Hence, GCD is
accepted under the principle of definition. From the definition we can
conclude that (NUMBERP (GCD X Y)) is a theorem.
[ 0.0 0.0 0.0 ]
GCD
(PROVE-LEMMA REMAINDER-EXP
(REWRITE)
(IMPLIES (NOT (ZEROP K))
(EQUAL (REMAINDER (EXP N K) N) 0))
((ENABLE EXP REMAINDER-TIMES1-INSTANCE)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, and
IMPLIES, to the goal:
(IMPLIES (AND (NOT (EQUAL K 0)) (NUMBERP K))
(EQUAL (REMAINDER (EXP N K) N) 0)).
Name the above subgoal *1.
We will appeal to induction. There is only one plausible induction. We
will induct according to the following scheme:
(AND (IMPLIES (ZEROP K) (p N K))
(IMPLIES (AND (NOT (ZEROP K)) (p N (SUB1 K)))
(p N K))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to prove that the measure (COUNT K) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme produces three new formulas:
Case 3. (IMPLIES (AND (ZEROP K)
(NOT (EQUAL K 0))
(NUMBERP K))
(EQUAL (REMAINDER (EXP N K) N) 0)),
which simplifies, opening up ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP K))
(EQUAL (SUB1 K) 0)
(NOT (EQUAL K 0))
(NUMBERP K))
(EQUAL (REMAINDER (EXP N K) N) 0)),
which simplifies, applying the lemmas EQUAL-SUB1-0, TIMES-1-ARG1, and
COMMUTATIVITY-OF-TIMES, and opening up the definitions of ZEROP, EQUAL,
NUMBERP, SUB1, and EXP, to two new conjectures:
Case 2.2.
(IMPLIES (AND (EQUAL K 1) (NOT (NUMBERP N)))
(EQUAL (REMAINDER 0 N) 0)),
which again simplifies, rewriting with REMAINDER-ZERO, and opening up the
functions ZEROP, NUMBERP, and EQUAL, to:
T.
Case 2.1.
(IMPLIES (AND (EQUAL K 1) (NUMBERP N))
(EQUAL (REMAINDER N N) 0)).
But this again simplifies, rewriting with REMAINDER-X-X, and opening up
the function EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP K))
(EQUAL (REMAINDER (EXP N (SUB1 K)) N)
0)
(NOT (EQUAL K 0))
(NUMBERP K))
(EQUAL (REMAINDER (EXP N K) N) 0)).
This simplifies, rewriting with REMAINDER-TIMES1-INSTANCE, and expanding the
functions ZEROP, EXP, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-EXP
(DEFN DOUBLE-NUMBER-INDUCTION
(I J)
(IF (ZEROP I)
0
(IF (ZEROP J)
0
(DOUBLE-NUMBER-INDUCTION (SUB1 I)
(SUB1 J)))))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT I) decreases according to the well-founded
relation LESSP in each recursive call. Hence, DOUBLE-NUMBER-INDUCTION is
accepted under the principle of definition. The definition of
DOUBLE-NUMBER-INDUCTION can be justified in another way. Linear arithmetic,
the lemma COUNT-NUMBERP, and the definition of ZEROP can be used to establish
that the measure (COUNT J) decreases according to the well-founded relation
LESSP in each recursive call. Note that:
(NUMBERP (DOUBLE-NUMBER-INDUCTION I J))
is a theorem.
[ 0.0 0.0 0.0 ]
DOUBLE-NUMBER-INDUCTION
(PROVE-LEMMA REMAINDER-EXP-EXP
(REWRITE)
(IMPLIES (LEQ I J)
(EQUAL (REMAINDER (EXP A J) (EXP A I))
0))
((ENABLE EXP REMAINDER-1-ARG2 REMAINDER-TIMES2-INSTANCE)
(INDUCT (DOUBLE-NUMBER-INDUCTION I J))))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to three new formulas:
Case 3. (IMPLIES (AND (ZEROP I) (NOT (LESSP J I)))
(EQUAL (REMAINDER (EXP A J) (EXP A I))
0)),
which simplifies, rewriting with REMAINDER-1-ARG2, and opening up the
definitions of ZEROP, EQUAL, LESSP, and EXP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(ZEROP J)
(NOT (LESSP J I)))
(EQUAL (REMAINDER (EXP A J) (EXP A I))
0)).
This simplifies, expanding ZEROP, EQUAL, and LESSP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL J 0))
(NUMBERP J)
(IMPLIES (IF (LESSP (SUB1 J) (SUB1 I)) F T)
(EQUAL (REMAINDER (EXP A (SUB1 J))
(EXP A (SUB1 I)))
0))
(NOT (LESSP J I)))
(EQUAL (REMAINDER (EXP A J) (EXP A I))
0)).
This simplifies, rewriting with COMMUTATIVITY-OF-TIMES and
REMAINDER-TIMES2-INSTANCE, and opening up IMPLIES, LESSP, EXP, EQUAL, and
TIMES, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
REMAINDER-EXP-EXP
(PROVE-LEMMA QUOTIENT-EXP
(REWRITE)
(IMPLIES (NOT (ZEROP K))
(EQUAL (QUOTIENT (EXP N K) N)
(IF (ZEROP N) 0 (EXP N (SUB1 K)))))
((ENABLE EXP QUOTIENT-TIMES-INSTANCE)))
This formula can be simplified, using the abbreviations ZEROP, NOT, and
IMPLIES, to:
(IMPLIES (AND (NOT (EQUAL K 0)) (NUMBERP K))
(EQUAL (QUOTIENT (EXP N K) N)
(IF (ZEROP N) 0 (EXP N (SUB1 K))))),
which simplifies, rewriting with QUOTIENT-TIMES-INSTANCE, and expanding the
definitions of EXP and ZEROP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-EXP
(PROVE-LEMMA EXP-ZERO
(REWRITE)
(IMPLIES (ZEROP K)
(EQUAL (EXP N K) 1))
((ENABLE EXP)))
This conjecture simplifies, expanding ZEROP, EQUAL, and EXP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EXP-ZERO
(PROVE-LEMMA EXP-ADD1
(REWRITE)
(EQUAL (EXP N (ADD1 K))
(TIMES N (EXP N K)))
((ENABLE EXP)))
This formula simplifies, applying SUB1-ADD1 and
CORRECTNESS-OF-CANCEL-EQUAL-TIMES, and opening up the functions EXP, ZEROP,
FIX, and OR, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (NUMBERP K)))
(EQUAL (EXP N 0) (EXP N K))),
which again simplifies, appealing to the lemma EXP-ZERO, and expanding ZEROP
and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EXP-ADD1
(PROVE-LEMMA EXP-PLUS
(REWRITE)
(EQUAL (EXP I (PLUS J K))
(TIMES (EXP I J) (EXP I K)))
((ENABLE EXP ASSOCIATIVITY-OF-TIMES COMMUTATIVITY-OF-TIMES)))
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 (ZEROP J) (p I J K))
(IMPLIES (AND (NOT (ZEROP J)) (p I (SUB1 J) K))
(p I J K))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definition
of ZEROP inform us that the measure (COUNT J) 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 J)
(EQUAL (EXP I (PLUS J K))
(TIMES (EXP I J) (EXP I K)))),
which simplifies, appealing to the lemmas EXP-ZERO and TIMES-1-ARG1, and
unfolding ZEROP, EQUAL, and PLUS, to two new formulas:
Case 2.2.
(IMPLIES (AND (EQUAL J 0) (NOT (NUMBERP K)))
(EQUAL (EXP I 0) (EXP I K))),
which again simplifies, applying EXP-ZERO, and opening up the functions
ZEROP and EQUAL, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP J))
(NOT (NUMBERP K)))
(EQUAL (EXP I 0) (EXP I K))).
But this again simplifies, applying the lemma EXP-ZERO, and expanding
ZEROP and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP J))
(EQUAL (EXP I (PLUS (SUB1 J) K))
(TIMES (EXP I (SUB1 J)) (EXP I K))))
(EQUAL (EXP I (PLUS J K))
(TIMES (EXP I J) (EXP I K)))),
which simplifies, applying the lemmas COMMUTATIVITY-OF-TIMES, EXP-ADD1, and
ASSOCIATIVITY-OF-TIMES, and opening up the functions ZEROP, PLUS, and EXP,
to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
EXP-PLUS
(PROVE-LEMMA EXP-0-ARG1
(REWRITE)
(EQUAL (EXP 0 K) (IF (ZEROP K) 1 0))
((ENABLE EXP)))
This simplifies, opening up the functions TIMES, EQUAL, EXP, and ZEROP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EXP-0-ARG1
(PROVE-LEMMA EXP-1-ARG1
(REWRITE)
(EQUAL (EXP 1 K) 1)
((ENABLE EXP)))
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 K) (p K))
(IMPLIES (AND (NOT (ZEROP K)) (p (SUB1 K)))
(p K))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to establish that the measure (COUNT K) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme generates the following two new formulas:
Case 2. (IMPLIES (ZEROP K)
(EQUAL (EXP 1 K) 1)).
This simplifies, applying EXP-ZERO, and expanding the functions ZEROP, EXP,
and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP K))
(EQUAL (EXP 1 (SUB1 K)) 1))
(EQUAL (EXP 1 K) 1)),
which simplifies, opening up the functions ZEROP, EXP, TIMES, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
EXP-1-ARG1
(PROVE-LEMMA EXP-0-ARG2
(REWRITE)
(EQUAL (EXP N 0) 1)
((ENABLE EXP)))
This simplifies, rewriting with EXP-ZERO, and unfolding ZEROP and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EXP-0-ARG2
(PROVE-LEMMA EXP-TIMES
(REWRITE)
(EQUAL (EXP (TIMES I J) K)
(TIMES (EXP I K) (EXP J K)))
((ENABLE EXP ASSOCIATIVITY-OF-TIMES COMMUTATIVITY2-OF-TIMES
EXP-ZERO)))
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 K) (p I J K))
(IMPLIES (AND (NOT (ZEROP K)) (p I J (SUB1 K)))
(p I J K))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT K) 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 K)
(EQUAL (EXP (TIMES I J) K)
(TIMES (EXP I K) (EXP J K)))),
which simplifies, appealing to the lemmas EXP-0-ARG2 and EXP-ZERO, and
unfolding ZEROP, TIMES, and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP K))
(EQUAL (EXP (TIMES I J) (SUB1 K))
(TIMES (EXP I (SUB1 K))
(EXP J (SUB1 K)))))
(EQUAL (EXP (TIMES I J) K)
(TIMES (EXP I K) (EXP J K)))),
which simplifies, rewriting with the lemmas ASSOCIATIVITY-OF-TIMES and
COMMUTATIVITY2-OF-TIMES, and expanding the functions ZEROP and EXP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
EXP-TIMES
(PROVE-LEMMA EXP-EXP
(REWRITE)
(EQUAL (EXP (EXP I J) K)
(EXP I (TIMES J K)))
((ENABLE EXP EXP-ZERO EXP-1-ARG1 EXP-PLUS EXP-TIMES)))
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 (ZEROP J) (p I J K))
(IMPLIES (AND (NOT (ZEROP J)) (p I (SUB1 J) K))
(p I J K))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to prove that the measure (COUNT J) 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 J)
(EQUAL (EXP (EXP I J) K)
(EXP I (TIMES J K)))),
which simplifies, applying the lemmas EXP-0-ARG2, EXP-1-ARG1, and EXP-ZERO,
and opening up the definitions of ZEROP, EQUAL, and TIMES, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP J))
(EQUAL (EXP (EXP I (SUB1 J)) K)
(EXP I (TIMES (SUB1 J) K))))
(EQUAL (EXP (EXP I J) K)
(EXP I (TIMES J K)))),
which simplifies, rewriting with EXP-TIMES and EXP-PLUS, and opening up the
functions ZEROP, EXP, and TIMES, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
EXP-EXP
(PROVE-LEMMA EQUAL-EXP-0
(REWRITE)
(EQUAL (EQUAL (EXP N K) 0)
(AND (ZEROP N) (NOT (ZEROP K))))
((ENABLE EXP EQUAL-TIMES-0)
(INDUCT (EXP N K))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, OR, and
AND, to two new goals:
Case 2. (IMPLIES (ZEROP K)
(EQUAL (EQUAL (EXP N K) 0)
(AND (ZEROP N) (NOT (ZEROP K))))),
which simplifies, applying EXP-0-ARG2 and EXP-ZERO, and opening up the
definitions of ZEROP, EQUAL, NOT, and AND, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL K 0))
(NUMBERP K)
(EQUAL (EQUAL (EXP N (SUB1 K)) 0)
(AND (ZEROP N)
(NOT (ZEROP (SUB1 K))))))
(EQUAL (EQUAL (EXP N K) 0)
(AND (ZEROP N) (NOT (ZEROP K))))).
This simplifies, applying EQUAL-SUB1-0, EXP-0-ARG1, COMMUTATIVITY-OF-TIMES,
TIMES-ZERO, EQUAL-TIMES-0, EXP-0-ARG2, TIMES-1-ARG1, and EXP-ADD1, and
expanding the functions ZEROP, NOT, AND, EQUAL, and EXP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-EXP-0
(PROVE-LEMMA EQUAL-EXP-1
(REWRITE)
(EQUAL (EQUAL (EXP N K) 1)
(IF (ZEROP K) T (EQUAL N 1)))
((ENABLE EXP TIMES-ZERO TIMES-ADD1)))
This simplifies, opening up the function ZEROP, to four new goals:
Case 4. (IMPLIES (NOT (EQUAL (EXP N K) 1))
(NOT (EQUAL K 0))),
which again simplifies, rewriting with EXP-0-ARG2, and unfolding the
function EQUAL, to:
T.
Case 3. (IMPLIES (NOT (EQUAL (EXP N K) 1))
(NUMBERP K)).
But this again simplifies, applying EXP-ZERO, and expanding the definitions
of ZEROP and EQUAL, to:
T.
Case 2. (IMPLIES (NOT (EQUAL (EXP N K) 1))
(NOT (EQUAL N 1))).
This again simplifies, rewriting with the lemma EXP-1-ARG1, and expanding
the definition of EQUAL, to:
T.
Case 1. (IMPLIES (AND (EQUAL (EXP N K) 1)
(NOT (EQUAL K 0))
(NUMBERP K))
(EQUAL (EQUAL N 1) T)),
which again simplifies, obviously, to:
(IMPLIES (AND (EQUAL (EXP N K) 1)
(NOT (EQUAL K 0))
(NUMBERP K))
(EQUAL N 1)),
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 K) (p N K))
(IMPLIES (AND (NOT (ZEROP K)) (p N (SUB1 K)))
(p N K))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to prove that the measure (COUNT K) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme generates three new formulas:
Case 3. (IMPLIES (AND (ZEROP K)
(EQUAL (EXP N K) 1)
(NOT (EQUAL K 0))
(NUMBERP K))
(EQUAL N 1)),
which simplifies, expanding the definition of ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP K))
(NOT (EQUAL (EXP N (SUB1 K)) 1))
(EQUAL (EXP N K) 1)
(NOT (EQUAL K 0))
(NUMBERP K))
(EQUAL N 1)),
which simplifies, applying EQUAL-TIMES-1, and expanding the definitions of
ZEROP and EXP, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP K))
(EQUAL (SUB1 K) 0)
(EQUAL (EXP N K) 1)
(NOT (EQUAL K 0))
(NUMBERP K))
(EQUAL N 1)).
This simplifies, appealing to the lemmas EQUAL-SUB1-0, EXP-0-ARG2,
TIMES-1-ARG1, COMMUTATIVITY-OF-TIMES, and EXP-ADD1, and opening up the
definition of ZEROP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-EXP-1
(PROVE-LEMMA EXP-DIFFERENCE
(REWRITE)
(IMPLIES (AND (LEQ C B) (NOT (ZEROP A)))
(EQUAL (EXP A (DIFFERENCE B C))
(QUOTIENT (EXP A B) (EXP A C))))
((ENABLE EXP)))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (NOT (LESSP B C))
(NOT (EQUAL A 0))
(NUMBERP A))
(EQUAL (EXP A (DIFFERENCE B C))
(QUOTIENT (EXP A B) (EXP A C)))).
Applying the lemma DIFFERENCE-ELIM, replace B by (PLUS C X) to eliminate
(DIFFERENCE B C). We rely upon the type restriction lemma noted when
DIFFERENCE was introduced to restrict the new variable. We thus obtain the
following two new formulas:
Case 2. (IMPLIES (AND (NOT (NUMBERP B))
(NOT (LESSP B C))
(NOT (EQUAL A 0))
(NUMBERP A))
(EQUAL (EXP A (DIFFERENCE B C))
(QUOTIENT (EXP A B) (EXP A C)))).
This simplifies, using linear arithmetic, rewriting with the lemmas
DIFFERENCE-LEQ-ARG1, EXP-0-ARG2, and EXP-ZERO, and expanding the functions
LESSP, ZEROP, QUOTIENT, and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NUMBERP X)
(NOT (LESSP (PLUS C X) C))
(NOT (EQUAL A 0))
(NUMBERP A))
(EQUAL (EXP A X)
(QUOTIENT (EXP A (PLUS C X))
(EXP A C)))),
which simplifies, applying the lemmas CORRECTNESS-OF-CANCEL-LESSP-PLUS,
EXP-PLUS, EQUAL-EXP-0, and QUOTIENT-TIMES-INSTANCE, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
EXP-DIFFERENCE
(PROVE-LEMMA EQUAL-LOG-0
(REWRITE)
(EQUAL (EQUAL (LOG BASE N) 0)
(OR (LESSP BASE 2) (ZEROP N)))
((ENABLE LOG) (INDUCT (LOG BASE N))))
This formula can be simplified, using the abbreviations ZEROP, NOT, OR, and
AND, to the following three new conjectures:
Case 3. (IMPLIES (LESSP BASE 2)
(EQUAL (EQUAL (LOG BASE N) 0)
(OR (LESSP BASE 2) (ZEROP N)))).
This simplifies, expanding LOG, EQUAL, ZEROP, and OR, to:
T.
Case 2. (IMPLIES (AND (NOT (LESSP BASE 2)) (ZEROP N))
(EQUAL (EQUAL (LOG BASE N) 0)
(OR (LESSP BASE 2) (ZEROP N)))).
This simplifies, expanding the functions ZEROP, EQUAL, LOG, and OR, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP BASE 2))
(NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (EQUAL (LOG BASE (QUOTIENT N BASE)) 0)
(OR (LESSP BASE 2)
(ZEROP (QUOTIENT N BASE)))))
(EQUAL (EQUAL (LOG BASE N) 0)
(OR (LESSP BASE 2) (ZEROP N)))).
This simplifies, applying EQUAL-QUOTIENT-0 and QUOTIENT-LESSP-ARG1, and
expanding the functions ZEROP, OR, LESSP, LOG, EQUAL, NUMBERP, and ADD1, to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
EQUAL-LOG-0
(PROVE-LEMMA LOG-0
(REWRITE)
(IMPLIES (ZEROP N)
(EQUAL (LOG BASE N) 0))
((ENABLE LOG)))
This formula can be simplified, using the abbreviations EQUAL-LOG-0 and
IMPLIES, to:
(IMPLIES (AND (ZEROP N)
(NOT (LESSP BASE 2))
(NOT (EQUAL N 0)))
(NOT (NUMBERP N))),
which simplifies, opening up the function ZEROP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LOG-0
(PROVE-LEMMA LOG-1
(REWRITE)
(IMPLIES (LESSP 1 BASE)
(EQUAL (LOG BASE 1) 1))
((ENABLE LOG) (INDUCT (LOG BASE N))))
This conjecture can be simplified, using the abbreviations IMPLIES, NOT, OR,
and AND, to two new goals:
Case 2. (IMPLIES (AND (LESSP BASE 2) (LESSP 1 BASE))
(EQUAL (LOG BASE 1) 1)),
which simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP BASE 2))
(ZEROP N)
(LESSP 1 BASE))
(EQUAL (LOG BASE 1) 1)),
which simplifies, expanding the definition of ZEROP, to two new formulas:
Case 1.2.
(IMPLIES (AND (NOT (LESSP BASE 2))
(EQUAL N 0)
(LESSP 1 BASE))
(EQUAL (LOG BASE 1) 1)),
which again simplifies, obviously, to:
(IMPLIES (AND (NOT (LESSP BASE 2))
(LESSP 1 BASE))
(EQUAL (LOG BASE 1) 1)),
which we will name *1.
Case 1.1.
(IMPLIES (AND (NOT (LESSP BASE 2))
(NOT (NUMBERP N))
(LESSP 1 BASE))
(EQUAL (LOG BASE 1) 1)).
Name the above subgoal *2.
This conjecture is subsumed by formula *1 above.
So we now return to:
(IMPLIES (AND (NOT (LESSP BASE 2))
(LESSP 1 BASE))
(EQUAL (LOG BASE 1) 1)),
which we named *1 above. Perhaps we can prove it by induction. The recursive
terms in the conjecture suggest two inductions. However, they merge into one
likely candidate induction. We will induct according to the following scheme:
(AND (IMPLIES (OR (EQUAL 2 0) (NOT (NUMBERP 2)))
(p BASE))
(IMPLIES (AND (NOT (OR (EQUAL 2 0) (NOT (NUMBERP 2))))
(OR (EQUAL BASE 0)
(NOT (NUMBERP BASE))))
(p BASE))
(IMPLIES (AND (NOT (OR (EQUAL 2 0) (NOT (NUMBERP 2))))
(NOT (OR (EQUAL BASE 0)
(NOT (NUMBERP BASE))))
(p (SUB1 BASE)))
(p BASE))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT establish that the measure (COUNT BASE) decreases according to
the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme generates the following five new goals:
Case 5. (IMPLIES (AND (OR (EQUAL 2 0) (NOT (NUMBERP 2)))
(NOT (LESSP BASE 2))
(LESSP 1 BASE))
(EQUAL (LOG BASE 1) 1)).
This simplifies, opening up EQUAL, NUMBERP, NOT, and OR, to:
T.
Case 4. (IMPLIES (AND (NOT (OR (EQUAL 2 0) (NOT (NUMBERP 2))))
(OR (EQUAL BASE 0)
(NOT (NUMBERP BASE)))
(NOT (LESSP BASE 2))
(LESSP 1 BASE))
(EQUAL (LOG BASE 1) 1)).
This simplifies, opening up the definitions of EQUAL, NUMBERP, NOT, OR, and
LESSP, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (EQUAL 2 0) (NOT (NUMBERP 2))))
(NOT (OR (EQUAL BASE 0)
(NOT (NUMBERP BASE))))
(LESSP (SUB1 BASE) 2)
(NOT (LESSP BASE 2))
(LESSP 1 BASE))
(EQUAL (LOG BASE 1) 1)).
This simplifies, using linear arithmetic, to the following two new goals:
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP BASE))
(NOT (OR (EQUAL 2 0) (NOT (NUMBERP 2))))
(NOT (OR (EQUAL BASE 0)
(NOT (NUMBERP BASE))))
(LESSP (SUB1 BASE) 2)
(NOT (LESSP BASE 2))
(LESSP 1 BASE))
(EQUAL (LOG BASE 1) 1)).
However this again simplifies, opening up the definitions of EQUAL,
NUMBERP, NOT, and OR, to:
T.
Case 3.1.
(IMPLIES (AND (NUMBERP BASE)
(NOT (OR (EQUAL 2 0) (NOT (NUMBERP 2))))
(NOT (OR (EQUAL 2 0) (NOT (NUMBERP 2))))
(LESSP (SUB1 2) 2)
(NOT (LESSP 2 2))
(LESSP 1 2))
(EQUAL (LOG 2 1) 1)),
which again simplifies, opening up the functions EQUAL, NUMBERP, NOT, OR,
SUB1, LESSP, and LOG, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL 2 0) (NOT (NUMBERP 2))))
(NOT (OR (EQUAL BASE 0)
(NOT (NUMBERP BASE))))
(NOT (LESSP 1 (SUB1 BASE)))
(NOT (LESSP BASE 2))
(LESSP 1 BASE))
(EQUAL (LOG BASE 1) 1)),
which simplifies, using linear arithmetic, to two new goals:
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP BASE))
(NOT (OR (EQUAL 2 0) (NOT (NUMBERP 2))))
(NOT (OR (EQUAL BASE 0)
(NOT (NUMBERP BASE))))
(NOT (LESSP 1 (SUB1 BASE)))
(NOT (LESSP BASE 2))
(LESSP 1 BASE))
(EQUAL (LOG BASE 1) 1)),
which again simplifies, expanding the definitions of EQUAL, NUMBERP, NOT,
and OR, to:
T.
Case 2.1.
(IMPLIES (AND (NUMBERP BASE)
(NOT (OR (EQUAL 2 0) (NOT (NUMBERP 2))))
(NOT (OR (EQUAL 2 0) (NOT (NUMBERP 2))))
(NOT (LESSP 1 (SUB1 2)))
(NOT (LESSP 2 2))
(LESSP 1 2))
(EQUAL (LOG 2 1) 1)),
which again simplifies, opening up the definitions of EQUAL, NUMBERP, NOT,
OR, SUB1, LESSP, and LOG, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL 2 0) (NOT (NUMBERP 2))))
(NOT (OR (EQUAL BASE 0)
(NOT (NUMBERP BASE))))
(EQUAL (LOG (SUB1 BASE) 1) 1)
(NOT (LESSP BASE 2))
(LESSP 1 BASE))
(EQUAL (LOG BASE 1) 1)),
which simplifies, rewriting with EQUAL-SUB1-0, LOG-0, and QUOTIENT-1-ARG1,
and expanding the functions EQUAL, NUMBERP, NOT, OR, LESSP, SUB1, ADD1,
ZEROP, and LOG, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LOG-1
(DEFN DOUBLE-LOG-INDUCTION
(BASE A B)
(IF (LESSP BASE 2)
0
(IF (ZEROP A)
0
(IF (ZEROP B)
0
(DOUBLE-LOG-INDUCTION BASE
(QUOTIENT A BASE)
(QUOTIENT B BASE))))))
Linear arithmetic, the lemmas LESSP-QUOTIENT and COUNT-NUMBERP, and the
definition of ZEROP inform us that the measure (COUNT A) decreases according
to the well-founded relation LESSP in each recursive call. Hence,
DOUBLE-LOG-INDUCTION is accepted under the definitional principle. The
definition of DOUBLE-LOG-INDUCTION can be justified in another way. Linear
arithmetic, the lemmas LESSP-QUOTIENT and COUNT-NUMBERP, and the definition of
ZEROP establish that the measure (COUNT B) decreases according to the
well-founded relation LESSP in each recursive call. Note that:
(NUMBERP (DOUBLE-LOG-INDUCTION BASE A B))
is a theorem.
[ 0.0 0.0 0.0 ]
DOUBLE-LOG-INDUCTION
(PROVE-LEMMA LEQ-LOG-LOG NIL
(IMPLIES (LEQ N M)
(LEQ (LOG C N) (LOG C M)))
((ENABLE LOG)
(INDUCT (DOUBLE-LOG-INDUCTION C N M))
(USE (LEQ-QUOTIENT (A N) (B M) (C C)))))
This formula simplifies, unfolding the definitions of IMPLIES, NOT, LOG, OR,
ZEROP, and AND, to the following 21 new goals:
Case 21.(IMPLIES (AND (NOT (LESSP N M))
(EQUAL N 0)
(NOT (LESSP M N))
(EQUAL M 0))
(NOT (LESSP 0 0))).
This again simplifies, obviously, to:
T.
Case 20.(IMPLIES (AND (NOT (LESSP N M))
(EQUAL N 0)
(NOT (LESSP M N))
(NOT (NUMBERP M)))
(NOT (LESSP 0 0))).
This again simplifies, using linear arithmetic, to:
T.
Case 19.(IMPLIES (AND (NOT (LESSP N M))
(NOT (NUMBERP N))
(NOT (LESSP M N))
(EQUAL M 0))
(NOT (LESSP 0 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 18.(IMPLIES (AND (NOT (LESSP N M))
(NOT (NUMBERP N))
(NOT (LESSP M N))
(NOT (NUMBERP M)))
(NOT (LESSP 0 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 17.(IMPLIES (AND (NOT (LESSP N M))
(LESSP C 2)
(NOT (LESSP M N)))
(NOT (LESSP 0 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 16.(IMPLIES (AND (NOT (LESSP N M))
(NOT (LESSP C 2))
(EQUAL N 0)
(NOT (LESSP M N))
(NOT (EQUAL M 0))
(NUMBERP M))
(NOT (LESSP (ADD1 (LOG C (QUOTIENT M C)))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 15.(IMPLIES (AND (NOT (LESSP N M))
(NOT (LESSP C 2))
(NOT (NUMBERP N))
(NOT (LESSP M N))
(NOT (EQUAL M 0))
(NUMBERP M))
(NOT (LESSP (ADD1 (LOG C (QUOTIENT M C)))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 14.(IMPLIES (AND (NOT (LESSP N M))
(NOT (LESSP C 2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (NUMBERP M))
(NOT (LESSP M N)))
(NOT (LESSP 0
(ADD1 (LOG C (QUOTIENT N C)))))),
which again simplifies, expanding LESSP, to:
T.
Case 13.(IMPLIES (AND (NOT (LESSP N M))
(NOT (LESSP C 2))
(NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL M 0)
(NOT (LESSP M N)))
(NOT (LESSP 0
(ADD1 (LOG C (QUOTIENT N C)))))),
which again simplifies, using linear arithmetic, to:
T.
Case 12.(IMPLIES (AND (NOT (LESSP N M))
(NOT (LESSP C 2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL M 0))
(NUMBERP M)
(LESSP (QUOTIENT M C) (QUOTIENT N C))
(NOT (LESSP M N)))
(NOT (LESSP (ADD1 (LOG C (QUOTIENT M C)))
(ADD1 (LOG C (QUOTIENT N C)))))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (LESSP M M))
(NOT (LESSP C 2))
(NOT (EQUAL M 0))
(NUMBERP M)
(NOT (EQUAL M 0))
(NUMBERP M)
(LESSP (QUOTIENT M C) (QUOTIENT M C))
(NOT (LESSP M M)))
(NOT (LESSP (ADD1 (LOG C (QUOTIENT M C)))
(ADD1 (LOG C (QUOTIENT M C)))))).
But this again simplifies, using linear arithmetic, to:
T.
Case 11.(IMPLIES (AND (NOT (LESSP N M))
(NOT (LESSP C 2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL M 0))
(NUMBERP M)
(NOT (LESSP (LOG C (QUOTIENT M C))
(LOG C (QUOTIENT N C))))
(NOT (LESSP M N)))
(NOT (LESSP (ADD1 (LOG C (QUOTIENT M C)))
(ADD1 (LOG C (QUOTIENT N C)))))),
which again simplifies, using linear arithmetic, to:
T.
Case 10.(IMPLIES (AND (NOT (LESSP (QUOTIENT M C) (QUOTIENT N C)))
(EQUAL N 0)
(NOT (LESSP M N))
(EQUAL M 0))
(NOT (LESSP 0 0))),
which again simplifies, obviously, to:
T.
Case 9. (IMPLIES (AND (NOT (LESSP (QUOTIENT M C) (QUOTIENT N C)))
(EQUAL N 0)
(NOT (LESSP M N))
(NOT (NUMBERP M)))
(NOT (LESSP 0 0))).
But this again simplifies, using linear arithmetic, to:
T.
Case 8. (IMPLIES (AND (NOT (LESSP (QUOTIENT M C) (QUOTIENT N C)))
(NOT (NUMBERP N))
(NOT (LESSP M N))
(EQUAL M 0))
(NOT (LESSP 0 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 7. (IMPLIES (AND (NOT (LESSP (QUOTIENT M C) (QUOTIENT N C)))
(NOT (NUMBERP N))
(NOT (LESSP M N))
(NOT (NUMBERP M)))
(NOT (LESSP 0 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 6. (IMPLIES (AND (NOT (LESSP (QUOTIENT M C) (QUOTIENT N C)))
(LESSP C 2)
(NOT (LESSP M N)))
(NOT (LESSP 0 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 5. (IMPLIES (AND (NOT (LESSP (QUOTIENT M C) (QUOTIENT N C)))
(NOT (LESSP C 2))
(EQUAL N 0)
(NOT (LESSP M N))
(NOT (EQUAL M 0))
(NUMBERP M))
(NOT (LESSP (ADD1 (LOG C (QUOTIENT M C)))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 4. (IMPLIES (AND (NOT (LESSP (QUOTIENT M C) (QUOTIENT N C)))
(NOT (LESSP C 2))
(NOT (NUMBERP N))
(NOT (LESSP M N))
(NOT (EQUAL M 0))
(NUMBERP M))
(NOT (LESSP (ADD1 (LOG C (QUOTIENT M C)))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (NOT (LESSP (QUOTIENT M C) (QUOTIENT N C)))
(NOT (LESSP C 2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (NUMBERP M))
(NOT (LESSP M N)))
(NOT (LESSP 0
(ADD1 (LOG C (QUOTIENT N C)))))),
which again simplifies, using linear arithmetic, rewriting with
QUOTIENT-LESSP-ARG1 and EQUAL-QUOTIENT-0, and opening up the functions EQUAL,
LESSP, and NUMBERP, to:
T.
Case 2. (IMPLIES (AND (NOT (LESSP (QUOTIENT M C) (QUOTIENT N C)))
(NOT (LESSP C 2))
(NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL M 0)
(NOT (LESSP M N)))
(NOT (LESSP 0
(ADD1 (LOG C (QUOTIENT N C)))))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (LESSP (QUOTIENT M C) (QUOTIENT N C)))
(NOT (LESSP C 2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL M 0))
(NUMBERP M)
(NOT (LESSP (LOG C (QUOTIENT M C))
(LOG C (QUOTIENT N C))))
(NOT (LESSP M N)))
(NOT (LESSP (ADD1 (LOG C (QUOTIENT M C)))
(ADD1 (LOG C (QUOTIENT N C)))))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 1.2 0.0 ]
LEQ-LOG-LOG
(PROVE-LEMMA LOG-QUOTIENT
(REWRITE)
(IMPLIES (LESSP 1 C)
(EQUAL (LOG C (QUOTIENT N C))
(SUB1 (LOG C N))))
((ENABLE LOG)))
This conjecture simplifies, unfolding the definition of LOG, to four new
conjectures:
Case 4. (IMPLIES (AND (LESSP 1 C) (EQUAL N 0))
(EQUAL (LOG C (QUOTIENT N C))
(SUB1 0))),
which again simplifies, using linear arithmetic, rewriting with
QUOTIENT-LESSP-ARG1 and LOG-0, and opening up the functions ZEROP, SUB1, and
EQUAL, to:
T.
Case 3. (IMPLIES (AND (LESSP 1 C) (NOT (NUMBERP N)))
(EQUAL (LOG C (QUOTIENT N C))
(SUB1 0))).
However this again simplifies, using linear arithmetic, rewriting with
QUOTIENT-LESSP-ARG1 and LOG-0, and unfolding the definitions of ZEROP, SUB1,
and EQUAL, to:
T.
Case 2. (IMPLIES (AND (LESSP 1 C) (LESSP C 2))
(EQUAL (LOG C (QUOTIENT N C))
(SUB1 0))).
This again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (LESSP 1 C)
(NOT (LESSP C 2))
(NOT (EQUAL N 0))
(NUMBERP N))
(EQUAL (LOG C (QUOTIENT N C))
(SUB1 (ADD1 (LOG C (QUOTIENT N C)))))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
LOG-QUOTIENT
(PROVE-LEMMA LOG-QUOTIENT-TIMES-PROOF NIL
(IMPLIES (LESSP 1 C)
(EQUAL (LOG C (QUOTIENT N (TIMES C M)))
(SUB1 (LOG C (QUOTIENT N M)))))
((ENABLE LOG)))
This formula simplifies, rewriting with QUOTIENT-QUOTIENT,
COMMUTATIVITY-OF-TIMES, and EQUAL-QUOTIENT-0, and opening up the definition of
LOG, to the following five new formulas:
Case 5. (IMPLIES (AND (LESSP 1 C) (LESSP C 2))
(EQUAL (LOG C (QUOTIENT N (TIMES C M)))
(SUB1 0))).
But this again simplifies, using linear arithmetic, to:
T.
Case 4. (IMPLIES (AND (LESSP 1 C) (EQUAL M 0))
(EQUAL (LOG C (QUOTIENT N (TIMES C M)))
(SUB1 0))),
which again simplifies, rewriting with COMMUTATIVITY-OF-TIMES, QUOTIENT-ZERO,
and LOG-0, and opening up EQUAL, TIMES, ZEROP, and SUB1, to:
T.
Case 3. (IMPLIES (AND (LESSP 1 C) (NOT (NUMBERP M)))
(EQUAL (LOG C (QUOTIENT N (TIMES C M)))
(SUB1 0))).
But this again simplifies, rewriting with TIMES-ZERO, QUOTIENT-ZERO, and
LOG-0, and expanding the functions ZEROP, SUB1, and EQUAL, to:
T.
Case 2. (IMPLIES (AND (LESSP 1 C) (LESSP N M))
(EQUAL (LOG C (QUOTIENT N (TIMES C M)))
(SUB1 0))).
However this again simplifies, rewriting with EQUAL-TIMES-0,
EQUAL-QUOTIENT-0, and EQUAL-LOG-0, and opening up the function SUB1, to:
(IMPLIES (AND (LESSP 1 C)
(LESSP N M)
(NOT (LESSP C 2))
(NOT (EQUAL C 0))
(NUMBERP C)
(NOT (EQUAL M 0))
(NUMBERP M))
(LESSP N (TIMES C M))),
which again simplifies, rewriting with the lemma LESSP-TIMES1, to:
T.
Case 1. (IMPLIES (AND (LESSP 1 C)
(NOT (LESSP C 2))
(NOT (EQUAL M 0))
(NUMBERP M)
(NOT (LESSP N M)))
(EQUAL (LOG C (QUOTIENT N (TIMES C M)))
(SUB1 (ADD1 (LOG C (QUOTIENT N (TIMES C M))))))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.5 0.0 ]
LOG-QUOTIENT-TIMES-PROOF
(PROVE-LEMMA LOG-QUOTIENT-TIMES
(REWRITE)
(IMPLIES (LESSP 1 C)
(AND (EQUAL (LOG C (QUOTIENT N (TIMES C M)))
(SUB1 (LOG C (QUOTIENT N M))))
(EQUAL (LOG C (QUOTIENT N (TIMES M C)))
(SUB1 (LOG C (QUOTIENT N M))))))
((USE (LOG-QUOTIENT-TIMES-PROOF (C C)
(N N)
(M M)))
(ENABLE COMMUTATIVITY-OF-TIMES)))
WARNING: Note that the proposed lemma LOG-QUOTIENT-TIMES is to be stored as
zero type prescription rules, zero compound recognizer rules, zero linear
rules, and two replacement rules.
This simplifies, applying QUOTIENT-QUOTIENT, COMMUTATIVITY-OF-TIMES,
EQUAL-QUOTIENT-0, QUOTIENT-ZERO, LOG-0, TIMES-ZERO, QUOTIENT-LESSP-ARG1,
EQUAL-SUB1-0, and SUB1-ADD1, and expanding the functions LOG, IMPLIES, SUB1,
EQUAL, AND, TIMES, and ZEROP, to:
T.
Q.E.D.
[ 0.0 1.0 0.0 ]
LOG-QUOTIENT-TIMES
(PROVE-LEMMA LOG-QUOTIENT-EXP
(REWRITE)
(IMPLIES (LESSP 1 C)
(EQUAL (LOG C (QUOTIENT N (EXP C M)))
(DIFFERENCE (LOG C N) M)))
((ENABLE EXP LOG LOG-QUOTIENT-TIMES)))
.
Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace N by:
(PLUS Z (TIMES (EXP C M) X))
to eliminate (QUOTIENT N (EXP C M)) and (REMAINDER N (EXP C M)). We employ
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 four new conjectures:
Case 4. (IMPLIES (AND (NOT (NUMBERP N)) (LESSP 1 C))
(EQUAL (LOG C (QUOTIENT N (EXP C M)))
(DIFFERENCE (LOG C N) M))),
which simplifies, using linear arithmetic, appealing to the lemmas
EQUAL-EXP-0, QUOTIENT-OF-NON-NUMBER, LOG-0, and DIFFERENCE-LEQ-ARG1, and
expanding the definitions of LESSP, EQUAL, QUOTIENT, and ZEROP, to:
T.
Case 3. (IMPLIES (AND (EQUAL (EXP C M) 0) (LESSP 1 C))
(EQUAL (LOG C (QUOTIENT N (EXP C M)))
(DIFFERENCE (LOG C N) M))),
which simplifies, rewriting with EQUAL-EXP-0, and expanding LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (NUMBERP (EXP C M)))
(LESSP 1 C))
(EQUAL (LOG C (QUOTIENT N (EXP C M)))
(DIFFERENCE (LOG C N) M))).
This simplifies, obviously, to:
T.
Case 1. (IMPLIES (AND (NUMBERP X)
(NUMBERP Z)
(EQUAL (LESSP Z (EXP C M))
(NOT (ZEROP (EXP C M))))
(NOT (EQUAL (EXP C M) 0))
(LESSP 1 C))
(EQUAL (LOG C X)
(DIFFERENCE (LOG C (PLUS Z (TIMES (EXP C M) X)))
M))).
But this simplifies, applying EQUAL-EXP-0, COMMUTATIVITY-OF-TIMES, EXP-ZERO,
TIMES-1-ARG1, COMMUTATIVITY-OF-PLUS, EQUAL-LOG-0, EQUAL-PLUS-0, EXP-0-ARG2,
and EXP-0-ARG1, and opening up the definitions of ZEROP, NOT, EQUAL,
DIFFERENCE, TIMES, and EXP, to the following nine new goals:
Case 1.9.
(IMPLIES (AND (NUMBERP X)
(NUMBERP Z)
(NOT (EQUAL C 0))
(NUMBERP C)
(EQUAL (LESSP Z (EXP C M)) T)
(LESSP 1 C))
(EQUAL (LOG C X)
(DIFFERENCE (LOG C (PLUS Z (TIMES X (EXP C M))))
M))).
This again simplifies, trivially, to:
(IMPLIES (AND (NUMBERP X)
(NUMBERP Z)
(NOT (EQUAL C 0))
(NUMBERP C)
(LESSP Z (EXP C M))
(LESSP 1 C))
(EQUAL (LOG C X)
(DIFFERENCE (LOG C (PLUS Z (TIMES X (EXP C M))))
M))),
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 (LESSP 1 C)
(EQUAL (LOG C (QUOTIENT N (EXP C M)))
(DIFFERENCE (LOG C N) M))),
named *1. Let us appeal to the induction principle. Five inductions are
suggested by terms in the conjecture. They merge into four likely candidate
inductions. However, only one is unflawed. We will induct according to the
following scheme:
(AND (IMPLIES (ZEROP M) (p C N M))
(IMPLIES (AND (NOT (ZEROP M)) (p C N (SUB1 M)))
(p C N M))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT M) decreases according to the well-founded relation
LESSP in each induction step of the scheme. The above induction scheme
generates two new formulas:
Case 2. (IMPLIES (AND (ZEROP M) (LESSP 1 C))
(EQUAL (LOG C (QUOTIENT N (EXP C M)))
(DIFFERENCE (LOG C N) M))),
which simplifies, applying EXP-0-ARG2, QUOTIENT-1-ARG2, EQUAL-LOG-0, and
EXP-ZERO, and unfolding the functions ZEROP, EQUAL, and DIFFERENCE, to the
following six new goals:
Case 2.6.
(IMPLIES (AND (EQUAL M 0)
(LESSP 1 C)
(NOT (NUMBERP N)))
(EQUAL (LOG C 0) 0)).
But this again simplifies, rewriting with LOG-0, and opening up the
functions ZEROP and EQUAL, to:
T.
Case 2.5.
(IMPLIES (AND (EQUAL M 0)
(LESSP 1 C)
(EQUAL N 0)
(NUMBERP N))
(EQUAL (LOG C N) 0)).
This again simplifies, rewriting with LOG-0, and expanding NUMBERP, ZEROP,
and EQUAL, to:
T.
Case 2.4.
(IMPLIES (AND (EQUAL M 0)
(LESSP 1 C)
(LESSP C 2)
(NUMBERP N))
(EQUAL (LOG C N) 0)).
But this again simplifies, using linear arithmetic, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (NUMBERP M))
(LESSP 1 C)
(NOT (NUMBERP N)))
(EQUAL (LOG C 0) 0)),
which again simplifies, rewriting with LOG-0, and opening up the
definitions of ZEROP and EQUAL, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP M))
(LESSP 1 C)
(EQUAL N 0)
(NUMBERP N))
(EQUAL (LOG C N) 0)).
But this again simplifies, appealing to the lemma LOG-0, and expanding the
definitions of NUMBERP, ZEROP, and EQUAL, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP M))
(LESSP 1 C)
(LESSP C 2)
(NUMBERP N))
(EQUAL (LOG C N) 0)),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP M))
(EQUAL (LOG C (QUOTIENT N (EXP C (SUB1 M))))
(DIFFERENCE (LOG C N) (SUB1 M)))
(LESSP 1 C))
(EQUAL (LOG C (QUOTIENT N (EXP C M)))
(DIFFERENCE (LOG C N) M))),
which simplifies, rewriting with LOG-QUOTIENT-TIMES, EQUAL-LOG-0, and
DIFFERENCE-SUB1-ARG2, and opening up the definitions of ZEROP, EXP, and
DIFFERENCE, to the following five new conjectures:
Case 1.5.
(IMPLIES (AND (NOT (EQUAL M 0))
(NUMBERP M)
(EQUAL (LOG C (QUOTIENT N (EXP C (SUB1 M))))
(DIFFERENCE (LOG C N) (SUB1 M)))
(LESSP 1 C)
(EQUAL N 0))
(EQUAL (SUB1 (DIFFERENCE (LOG C N) (SUB1 M)))
0)).
This again simplifies, applying the lemmas EQUAL-EXP-0, EQUAL-SUB1-0,
LOG-0, and DIFFERENCE-SUB1-ARG2, and expanding LESSP, EQUAL, QUOTIENT,
ZEROP, and SUB1, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL M 0))
(NUMBERP M)
(EQUAL (LOG C (QUOTIENT N (EXP C (SUB1 M))))
(DIFFERENCE (LOG C N) (SUB1 M)))
(LESSP 1 C)
(NOT (NUMBERP N)))
(EQUAL (SUB1 (DIFFERENCE (LOG C N) (SUB1 M)))
0)),
which again simplifies, rewriting with EQUAL-EXP-0, EQUAL-SUB1-0,
QUOTIENT-OF-NON-NUMBER, LOG-0, EQUAL-LOG-0, and EQUAL-DIFFERENCE-0, and
opening up the functions LESSP, EQUAL, QUOTIENT, and ZEROP, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL M 0))
(NUMBERP M)
(EQUAL (LOG C (QUOTIENT N (EXP C (SUB1 M))))
(DIFFERENCE (LOG C N) (SUB1 M)))
(LESSP 1 C)
(LESSP (SUB1 (LOG C N)) M))
(EQUAL (SUB1 (DIFFERENCE (LOG C N) (SUB1 M)))
0)).
This again simplifies, using linear arithmetic, to three new goals:
Case 1.3.3.
(IMPLIES (AND (LESSP (LOG C N) (SUB1 M))
(NOT (EQUAL M 0))
(NUMBERP M)
(EQUAL (LOG C (QUOTIENT N (EXP C (SUB1 M))))
(DIFFERENCE (LOG C N) (SUB1 M)))
(LESSP 1 C)
(LESSP (SUB1 (LOG C N)) M))
(EQUAL (SUB1 (DIFFERENCE (LOG C N) (SUB1 M)))
0)),
which again simplifies, applying EQUAL-DIFFERENCE-0 and EQUAL-SUB1-0, to:
(IMPLIES (AND (LESSP (LOG C N) (SUB1 M))
(NOT (EQUAL M 0))
(NUMBERP M)
(EQUAL (LOG C (QUOTIENT N (EXP C (SUB1 M))))
(DIFFERENCE (LOG C N) (SUB1 M)))
(LESSP 1 C)
(LESSP (SUB1 (LOG C N)) M)
(LESSP (SUB1 M) (LOG C N)))
(EQUAL (DIFFERENCE (LOG C N) (SUB1 M))
1)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.2.
(IMPLIES (AND (NOT (LESSP (SUB1 M) (LOG C N)))
(NOT (EQUAL M 0))
(NUMBERP M)
(EQUAL (LOG C (QUOTIENT N (EXP C (SUB1 M))))
(DIFFERENCE (LOG C N) (SUB1 M)))
(LESSP 1 C)
(LESSP (SUB1 (LOG C N)) M))
(EQUAL (SUB1 (DIFFERENCE (LOG C N) (SUB1 M)))
0)),
which again simplifies, applying EQUAL-DIFFERENCE-0 and EQUAL-SUB1-0, to:
T.
Case 1.3.1.
(IMPLIES
(AND (LESSP (SUB1 M) (LOG C N))
(NOT (LESSP (LOG C N) (SUB1 M)))
(NOT (EQUAL (PLUS 1 (LOG C N)) 0))
(NUMBERP (PLUS 1 (LOG C N)))
(EQUAL (LOG C
(QUOTIENT N
(EXP C (SUB1 (PLUS 1 (LOG C N))))))
(DIFFERENCE (LOG C N)
(SUB1 (PLUS 1 (LOG C N)))))
(LESSP 1 C)
(LESSP (SUB1 (LOG C N))
(PLUS 1 (LOG C N))))
(EQUAL (SUB1 (DIFFERENCE (LOG C N)
(SUB1 (PLUS 1 (LOG C N)))))
0)).
This again simplifies, rewriting with PLUS-ADD1-ARG1, SUB1-ADD1,
DIFFERENCE-X-X, EQUAL-LOG-0, EQUAL-EXP-0, EQUAL-QUOTIENT-0, EQUAL-SUB1-0,
and LOG-0, and opening up the functions EQUAL, PLUS, LESSP, NUMBERP, LOG,
SUB1, DIFFERENCE, and ZEROP, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL M 0))
(NUMBERP M)
(EQUAL (LOG C (QUOTIENT N (EXP C (SUB1 M))))
(DIFFERENCE (LOG C N) (SUB1 M)))
(LESSP 1 C)
(LESSP C 2))
(EQUAL (SUB1 (DIFFERENCE (LOG C N) (SUB1 M)))
0)).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL M 0))
(NUMBERP M)
(EQUAL (LOG C (QUOTIENT N (EXP C (SUB1 M))))
(DIFFERENCE (LOG C N) (SUB1 M)))
(LESSP 1 C)
(NOT (LESSP C 2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 (LOG C N)) M)))
(EQUAL (SUB1 (DIFFERENCE (LOG C N) (SUB1 M)))
(ADD1 (DIFFERENCE (SUB1 (LOG C N)) M)))),
which again simplifies, using linear arithmetic, to three new conjectures:
Case 1.1.3.
(IMPLIES (AND (NOT (LESSP (SUB1 M) (LOG C N)))
(NOT (EQUAL M 0))
(NUMBERP M)
(EQUAL (LOG C (QUOTIENT N (EXP C (SUB1 M))))
(DIFFERENCE (LOG C N) (SUB1 M)))
(LESSP 1 C)
(NOT (LESSP C 2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 (LOG C N)) M)))
(EQUAL (SUB1 (DIFFERENCE (LOG C N) (SUB1 M)))
(ADD1 (DIFFERENCE (SUB1 (LOG C N)) M)))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (EQUAL (LOG C N) 0)
(NOT (LESSP (SUB1 M) (LOG C N)))
(NOT (EQUAL M 0))
(NUMBERP M)
(EQUAL (LOG C (QUOTIENT N (EXP C (SUB1 M))))
(DIFFERENCE (LOG C N) (SUB1 M)))
(LESSP 1 C)
(NOT (LESSP C 2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 (LOG C N)) M)))
(EQUAL (SUB1 (DIFFERENCE (LOG C N) (SUB1 M)))
(ADD1 (DIFFERENCE (SUB1 (LOG C N)) M)))).
But this again simplifies, applying EQUAL-LOG-0, to:
T.
Case 1.1.2.
(IMPLIES (AND (LESSP (LOG C N) (SUB1 M))
(NOT (EQUAL M 0))
(NUMBERP M)
(EQUAL (LOG C (QUOTIENT N (EXP C (SUB1 M))))
(DIFFERENCE (LOG C N) (SUB1 M)))
(LESSP 1 C)
(NOT (LESSP C 2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 (LOG C N)) M)))
(EQUAL (SUB1 (DIFFERENCE (LOG C N) (SUB1 M)))
(ADD1 (DIFFERENCE (SUB1 (LOG C N)) M)))).
But this again simplifies, using linear arithmetic, to the formula:
(IMPLIES (AND (EQUAL (LOG C N) 0)
(LESSP (LOG C N) (SUB1 M))
(NOT (EQUAL M 0))
(NUMBERP M)
(EQUAL (LOG C (QUOTIENT N (EXP C (SUB1 M))))
(DIFFERENCE (LOG C N) (SUB1 M)))
(LESSP 1 C)
(NOT (LESSP C 2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 (LOG C N)) M)))
(EQUAL (SUB1 (DIFFERENCE (LOG C N) (SUB1 M)))
(ADD1 (DIFFERENCE (SUB1 (LOG C N)) M)))).
However this again simplifies, rewriting with EQUAL-LOG-0, to:
T.
Case 1.1.1.
(IMPLIES (AND (EQUAL (LOG C N) 0)
(NOT (EQUAL M 0))
(NUMBERP M)
(EQUAL (LOG C (QUOTIENT N (EXP C (SUB1 M))))
(DIFFERENCE (LOG C N) (SUB1 M)))
(LESSP 1 C)
(NOT (LESSP C 2))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 (LOG C N)) M)))
(EQUAL (SUB1 (DIFFERENCE (LOG C N) (SUB1 M)))
(ADD1 (DIFFERENCE (SUB1 (LOG C N)) M)))).
However this again simplifies, applying the lemma EQUAL-LOG-0, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 1.3 0.1 ]
LOG-QUOTIENT-EXP
(PROVE-LEMMA LOG-TIMES-PROOF NIL
(IMPLIES (AND (LESSP 1 C) (NOT (ZEROP N)))
(EQUAL (LOG C (TIMES C N))
(ADD1 (LOG C N))))
((ENABLE LOG)))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (LESSP 1 C)
(NOT (EQUAL N 0))
(NUMBERP N))
(EQUAL (LOG C (TIMES C N))
(ADD1 (LOG C N)))),
which simplifies, rewriting with QUOTIENT-TIMES-INSTANCE and EQUAL-TIMES-0,
and expanding the definition of LOG, to the following three new goals:
Case 3. (IMPLIES (AND (LESSP 1 C)
(NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL C 0))
(EQUAL 0 (ADD1 (LOG C N)))).
But this again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (LESSP 1 C)
(NOT (EQUAL N 0))
(NUMBERP N)
(LESSP C 2))
(EQUAL 0 (ADD1 (LOG C N)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (LESSP 1 C)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (NUMBERP C)))
(EQUAL 0 (ADD1 (LOG C N)))),
which again simplifies, expanding LESSP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LOG-TIMES-PROOF
(PROVE-LEMMA LOG-TIMES
(REWRITE)
(IMPLIES (AND (LESSP 1 C) (NOT (ZEROP N)))
(AND (EQUAL (LOG C (TIMES C N))
(ADD1 (LOG C N)))