(BOOT-STRAP NQTHM)
[ 0.0 0.1 0.0 ]
GROUND-ZERO
(DEFN RATE-PROXIMITY
(W R)
(AND (NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))))
From the definition we can conclude that:
(OR (FALSEP (RATE-PROXIMITY W R))
(TRUEP (RATE-PROXIMITY W R)))
is a theorem.
[ 0.0 0.0 0.0 ]
RATE-PROXIMITY
(PROVE-LEMMA PLUS-ADD1
(REWRITE)
(EQUAL (PLUS X (ADD1 Y))
(ADD1 (PLUS X Y))))
This conjecture simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
PLUS-ADD1
(PROVE-LEMMA PLUS-COMMUTES1
(REWRITE)
(EQUAL (PLUS X Y) (PLUS Y X)))
WARNING: the newly proposed lemma, PLUS-COMMUTES1, could be applied whenever
the previously added lemma PLUS-ADD1 could.
This formula simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
PLUS-COMMUTES1
(PROVE-LEMMA PLUS-COMMUTES2
(REWRITE)
(EQUAL (PLUS X Y Z) (PLUS Y X Z)))
WARNING: the previously added lemma, PLUS-COMMUTES1, could be applied
whenever the newly proposed PLUS-COMMUTES2 could!
This simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
PLUS-COMMUTES2
(PROVE-LEMMA PLUS-ASSOCIATES
(REWRITE)
(EQUAL (PLUS (PLUS X Y) Z)
(PLUS X Y Z)))
WARNING: the previously added lemma, PLUS-COMMUTES1, could be applied
whenever the newly proposed PLUS-ASSOCIATES could!
This simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
PLUS-ASSOCIATES
(PROVE-LEMMA TIMES-0
(REWRITE)
(EQUAL (TIMES X 0) 0))
Call the conjecture *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP X) (p X))
(IMPLIES (AND (NOT (ZEROP X)) (p (SUB1 X)))
(p X))).
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 the following two new formulas:
Case 2. (IMPLIES (ZEROP X)
(EQUAL (TIMES X 0) 0)).
This simplifies, expanding the definitions of ZEROP, TIMES, and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(EQUAL (TIMES (SUB1 X) 0) 0))
(EQUAL (TIMES X 0) 0)).
This simplifies, opening up the functions ZEROP, TIMES, PLUS, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-0
(PROVE-LEMMA TIMES-NON-NUMBERP
(REWRITE)
(IMPLIES (NOT (NUMBERP Z))
(EQUAL (TIMES X Z) 0)))
Call the conjecture *1.
Perhaps we can prove it by induction. There is only one plausible
induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP X) (p X Z))
(IMPLIES (AND (NOT (ZEROP X)) (p (SUB1 X) Z))
(p X Z))).
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 two new goals:
Case 2. (IMPLIES (AND (ZEROP X) (NOT (NUMBERP Z)))
(EQUAL (TIMES X Z) 0)),
which simplifies, opening up the definitions of ZEROP, EQUAL, and TIMES, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(EQUAL (TIMES (SUB1 X) Z) 0)
(NOT (NUMBERP Z)))
(EQUAL (TIMES X Z) 0)),
which simplifies, applying PLUS-COMMUTES1, and unfolding ZEROP, TIMES, EQUAL,
and PLUS, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-NON-NUMBERP
(PROVE-LEMMA TIMES-ADD1
(REWRITE)
(EQUAL (TIMES X (ADD1 Y))
(PLUS X (TIMES X Y))))
Give the conjecture the name *1.
We will try to prove it by induction. There are three plausible
inductions. However, they merge into one likely candidate induction. We will
induct according to the following scheme:
(AND (IMPLIES (ZEROP X) (p X Y))
(IMPLIES (AND (NOT (ZEROP X)) (p (SUB1 X) Y))
(p X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT X) decreases according to the well-founded relation
LESSP in each induction step of the scheme. The above induction scheme
generates two new goals:
Case 2. (IMPLIES (ZEROP X)
(EQUAL (TIMES X (ADD1 Y))
(PLUS X (TIMES X Y)))),
which simplifies, applying PLUS-COMMUTES1, and unfolding the functions ZEROP,
EQUAL, TIMES, and PLUS, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(EQUAL (TIMES (SUB1 X) (ADD1 Y))
(PLUS (SUB1 X) (TIMES (SUB1 X) Y))))
(EQUAL (TIMES X (ADD1 Y))
(PLUS X (TIMES X Y)))).
This simplifies, rewriting with the lemma SUB1-ADD1, and expanding the
functions ZEROP, TIMES, and PLUS, to the following two new formulas:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (TIMES (SUB1 X) (ADD1 Y))
(PLUS (SUB1 X) (TIMES (SUB1 X) Y)))
(NOT (NUMBERP Y)))
(EQUAL (ADD1 (PLUS 0 (TIMES (SUB1 X) (ADD1 Y))))
(PLUS X Y (TIMES (SUB1 X) Y)))).
But this again simplifies, unfolding the functions EQUAL and PLUS, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (TIMES (SUB1 X) (ADD1 Y))
(PLUS (SUB1 X) (TIMES (SUB1 X) Y)))
(NUMBERP Y))
(EQUAL (ADD1 (PLUS Y (TIMES (SUB1 X) (ADD1 Y))))
(PLUS X Y (TIMES (SUB1 X) Y)))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-ADD1
(PROVE-LEMMA TIMES-DISTRIBUTES1
(REWRITE)
(EQUAL (TIMES X (PLUS Y Z))
(PLUS (TIMES X Y) (TIMES X Z))))
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 PLUS-ASSOCIATES and PLUS-COMMUTES2, and unfolding
the functions ZEROP and TIMES, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-DISTRIBUTES1
(PROVE-LEMMA TIMES-COMMUTES1
(REWRITE)
(EQUAL (TIMES X Y) (TIMES Y X)))
WARNING: the newly proposed lemma, TIMES-COMMUTES1, could be applied whenever
the previously added lemma TIMES-DISTRIBUTES1 could.
WARNING: the newly proposed lemma, TIMES-COMMUTES1, could be applied whenever
the previously added lemma TIMES-ADD1 could.
WARNING: the newly proposed lemma, TIMES-COMMUTES1, could be applied whenever
the previously added lemma TIMES-NON-NUMBERP could.
WARNING: the newly proposed lemma, TIMES-COMMUTES1, could be applied whenever
the previously added lemma TIMES-0 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 X) (p X Y))
(IMPLIES (AND (NOT (ZEROP X)) (p (SUB1 X) Y))
(p X Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT X) decreases according to the well-founded relation
LESSP in each induction step of the scheme. The above induction scheme
produces the following two new conjectures:
Case 2. (IMPLIES (ZEROP X)
(EQUAL (TIMES X Y) (TIMES Y X))).
This simplifies, applying TIMES-0 and TIMES-NON-NUMBERP, and opening up the
functions ZEROP, EQUAL, and TIMES, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(EQUAL (TIMES (SUB1 X) Y)
(TIMES Y (SUB1 X))))
(EQUAL (TIMES X Y) (TIMES Y X))),
which simplifies, unfolding the functions ZEROP and TIMES, to:
(IMPLIES (AND (NOT (EQUAL X 0))
(NUMBERP X)
(EQUAL (TIMES (SUB1 X) Y)
(TIMES Y (SUB1 X))))
(EQUAL (PLUS Y (TIMES Y (SUB1 X)))
(TIMES Y X))).
Appealing to the lemma SUB1-ELIM, we now replace X by (ADD1 Z) to eliminate
(SUB1 X). 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 Y) (TIMES Y Z)))
(EQUAL (PLUS Y (TIMES Y Z))
(TIMES Y (ADD1 Z)))).
However this further simplifies, applying the lemma TIMES-ADD1, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-COMMUTES1
(PROVE-LEMMA TIMES-COMMUTES2
(REWRITE)
(EQUAL (TIMES X Y Z) (TIMES Y X Z)))
WARNING: the previously added lemma, TIMES-COMMUTES1, could be applied
whenever the newly proposed TIMES-COMMUTES2 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 TIMES-COMMUTES1, 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-DISTRIBUTES1, and opening up the
functions ZEROP and TIMES, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-COMMUTES2
(PROVE-LEMMA TIMES-ASSOCIATES
(REWRITE)
(EQUAL (TIMES (TIMES X Y) Z)
(TIMES X Y Z)))
WARNING: the previously added lemma, TIMES-COMMUTES1, could be applied
whenever the newly proposed TIMES-ASSOCIATES could!
This simplifies, rewriting with TIMES-COMMUTES1 and TIMES-COMMUTES2, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-ASSOCIATES
(PROVE-LEMMA TIMES-DISTRIBUTES2
(REWRITE)
(EQUAL (TIMES (PLUS X Y) Z)
(PLUS (TIMES X Z) (TIMES Y Z))))
WARNING: the previously added lemma, TIMES-COMMUTES1, could be applied
whenever the newly proposed TIMES-DISTRIBUTES2 could!
This simplifies, appealing to the lemmas TIMES-COMMUTES1 and
TIMES-DISTRIBUTES1, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-DISTRIBUTES2
(PROVE-LEMMA DIFFERENCE-IS-0
(REWRITE)
(IMPLIES (NOT (LESSP Y X))
(EQUAL (DIFFERENCE X Y) 0)))
Name the conjecture *1.
Let us appeal to the induction principle. 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 (OR (EQUAL X 0) (NOT (NUMBERP X)))
(p X Y))
(IMPLIES (AND (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
(OR (EQUAL Y 0) (NOT (NUMBERP Y))))
(p X Y))
(IMPLIES (AND (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
(NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
(p (SUB1 X) (SUB1 Y)))
(p X Y))).
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 Y) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. Note, however, the inductive instance chosen for X. The above
induction scheme leads to the following four new goals:
Case 4. (IMPLIES (AND (OR (EQUAL X 0) (NOT (NUMBERP X)))
(NOT (LESSP Y X)))
(EQUAL (DIFFERENCE X Y) 0)).
This simplifies, expanding the definitions of NOT, OR, EQUAL, LESSP, and
DIFFERENCE, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
(OR (EQUAL Y 0) (NOT (NUMBERP Y)))
(NOT (LESSP Y X)))
(EQUAL (DIFFERENCE X Y) 0)).
This simplifies, unfolding NOT, OR, EQUAL, and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
(NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
(LESSP (SUB1 Y) (SUB1 X))
(NOT (LESSP Y X)))
(EQUAL (DIFFERENCE X Y) 0)).
This simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP X 1)
(NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
(NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
(LESSP (SUB1 Y) (SUB1 X))
(NOT (LESSP Y X)))
(EQUAL (DIFFERENCE X Y) 0)),
which again simplifies, opening up the definitions of SUB1, NUMBERP, EQUAL,
LESSP, NOT, and OR, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
(NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)
(NOT (LESSP Y X)))
(EQUAL (DIFFERENCE X Y) 0)),
which simplifies, using linear arithmetic, to three new conjectures:
Case 1.3.
(IMPLIES (AND (LESSP X Y)
(NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
(NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)
(NOT (LESSP Y X)))
(EQUAL (DIFFERENCE X Y) 0)),
which again simplifies, using linear arithmetic, to two new conjectures:
Case 1.3.2.
(IMPLIES (AND (LESSP (SUB1 X) (SUB1 Y))
(LESSP X Y)
(NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
(NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)
(NOT (LESSP Y X)))
(EQUAL (DIFFERENCE X Y) 0)),
which again simplifies, unfolding the functions LESSP, NOT, OR,
DIFFERENCE, and EQUAL, to:
T.
Case 1.3.1.
(IMPLIES (AND (LESSP X 1)
(LESSP X Y)
(NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
(NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)
(NOT (LESSP Y X)))
(EQUAL (DIFFERENCE X Y) 0)),
which again simplifies, unfolding SUB1, NUMBERP, EQUAL, LESSP, NOT, and
OR, to:
T.
Case 1.2.
(IMPLIES (AND (LESSP (SUB1 X) (SUB1 Y))
(NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
(NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)
(NOT (LESSP Y X)))
(EQUAL (DIFFERENCE X Y) 0)),
which again simplifies, expanding the definitions of NOT, OR, LESSP,
DIFFERENCE, and EQUAL, to:
T.
Case 1.1.
(IMPLIES (AND (LESSP X 1)
(NOT (OR (EQUAL X 0) (NOT (NUMBERP X))))
(NOT (OR (EQUAL Y 0) (NOT (NUMBERP Y))))
(EQUAL (DIFFERENCE (SUB1 X) (SUB1 Y))
0)
(NOT (LESSP Y X)))
(EQUAL (DIFFERENCE X Y) 0)),
which again simplifies, opening up the definitions of SUB1, NUMBERP, EQUAL,
LESSP, NOT, and OR, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
DIFFERENCE-IS-0
(PROVE-LEMMA DIFFERENCE-PLUS-CANCELLATION1
(REWRITE)
(EQUAL (DIFFERENCE (PLUS I X) I)
(FIX X)))
This conjecture simplifies, opening up the function FIX, to the following two
new goals:
Case 2. (IMPLIES (NOT (NUMBERP X))
(EQUAL (DIFFERENCE (PLUS I X) I) 0)).
But this again simplifies, using linear arithmetic, applying DIFFERENCE-IS-0,
and expanding EQUAL, to:
T.
Case 1. (IMPLIES (NUMBERP X)
(EQUAL (DIFFERENCE (PLUS I X) I) X)).
However this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP (PLUS I X) I) (NUMBERP X))
(EQUAL (DIFFERENCE (PLUS I X) I) X)).
This again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-PLUS-CANCELLATION1
(PROVE-LEMMA DIFFERENCE-PLUS-CANCELLATION2
(REWRITE)
(EQUAL (DIFFERENCE (PLUS I X) (PLUS I Y))
(DIFFERENCE X Y)))
This simplifies, using linear arithmetic, to the following two new conjectures:
Case 2. (IMPLIES (LESSP (PLUS I X) (PLUS I Y))
(EQUAL (DIFFERENCE (PLUS I X) (PLUS I Y))
(DIFFERENCE X Y))).
But this again simplifies, using linear arithmetic, applying DIFFERENCE-IS-0,
and opening up the function EQUAL, to:
T.
Case 1. (IMPLIES (LESSP X Y)
(EQUAL (DIFFERENCE (PLUS I X) (PLUS I Y))
(DIFFERENCE X Y))).
But this again simplifies, using linear arithmetic, applying the lemma
DIFFERENCE-IS-0, and expanding EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-PLUS-CANCELLATION2
(PROVE-LEMMA DIFFERENCE-PLUS-CANCELLATION3
(REWRITE)
(EQUAL (DIFFERENCE (PLUS I J X) J)
(PLUS I X)))
This simplifies, using linear arithmetic, to:
(IMPLIES (LESSP (PLUS I J X) J)
(EQUAL (DIFFERENCE (PLUS I J X) J)
(PLUS I X))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-PLUS-CANCELLATION3
(PROVE-LEMMA LESSP-REMAINDER
(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-QUOTIENT-ELIM
(ELIM REWRITE)
(IMPLIES (NUMBERP X)
(EQUAL (PLUS (REMAINDER X Y)
(TIMES Y (QUOTIENT X Y)))
X)))
WARNING: the previously added lemma, PLUS-COMMUTES1, could be applied
whenever the newly proposed REMAINDER-QUOTIENT-ELIM could!
Give the conjecture the name *1.
Let us appeal to the induction principle. 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 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 generates the following three new
conjectures:
Case 3. (IMPLIES (AND (ZEROP Y) (NUMBERP X))
(EQUAL (PLUS (REMAINDER X Y)
(TIMES Y (QUOTIENT X Y)))
X)).
This simplifies, appealing to the lemmas PLUS-COMMUTES1, TIMES-NON-NUMBERP,
and TIMES-COMMUTES1, and expanding the functions ZEROP, EQUAL, REMAINDER,
QUOTIENT, TIMES, and PLUS, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP Y))
(LESSP X Y)
(NUMBERP X))
(EQUAL (PLUS (REMAINDER X Y)
(TIMES Y (QUOTIENT X Y)))
X)).
This simplifies, applying TIMES-COMMUTES1 and PLUS-COMMUTES1, and expanding
the definitions of ZEROP, REMAINDER, QUOTIENT, EQUAL, TIMES, and PLUS, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP Y))
(NOT (LESSP X Y))
(EQUAL (PLUS (REMAINDER (DIFFERENCE X Y) Y)
(TIMES Y
(QUOTIENT (DIFFERENCE X Y) Y)))
(DIFFERENCE X Y))
(NUMBERP X))
(EQUAL (PLUS (REMAINDER X Y)
(TIMES Y (QUOTIENT X Y)))
X)),
which simplifies, applying TIMES-ADD1 and PLUS-COMMUTES2, and opening up
ZEROP, REMAINDER, and QUOTIENT, to:
(IMPLIES (AND (NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (LESSP X Y))
(EQUAL (PLUS (REMAINDER (DIFFERENCE X Y) Y)
(TIMES Y
(QUOTIENT (DIFFERENCE X Y) Y)))
(DIFFERENCE X Y))
(NUMBERP X))
(EQUAL (PLUS Y (DIFFERENCE X Y)) X)),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
REMAINDER-QUOTIENT-ELIM
(PROVE-LEMMA QUOTIENT-PLUS-TIMES
(REWRITE)
(IMPLIES (NOT (ZEROP W))
(EQUAL (QUOTIENT (PLUS V (TIMES W I)) W)
(PLUS I (QUOTIENT V W))))
((INDUCT (TIMES I W))))
This formula can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to the following two new conjectures:
Case 2. (IMPLIES (AND (ZEROP I)
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (QUOTIENT (PLUS V (TIMES W I)) W)
(PLUS I (QUOTIENT V W)))).
This simplifies, applying the lemmas TIMES-COMMUTES1 and PLUS-COMMUTES1, and
unfolding ZEROP, EQUAL, TIMES, and PLUS, to the following two new formulas:
Case 2.2.
(IMPLIES (AND (EQUAL I 0)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (NUMBERP V)))
(EQUAL (QUOTIENT 0 W)
(QUOTIENT V W))).
This again simplifies, expanding the functions LESSP, EQUAL, and QUOTIENT,
to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP I))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (NUMBERP V)))
(EQUAL (QUOTIENT 0 W)
(QUOTIENT V W))),
which again simplifies, unfolding the definitions of LESSP, EQUAL, and
QUOTIENT, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(IMPLIES (NOT (ZEROP W))
(EQUAL (QUOTIENT (PLUS V (TIMES W (SUB1 I)))
W)
(PLUS (SUB1 I) (QUOTIENT V W))))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (QUOTIENT (PLUS V (TIMES W I)) W)
(PLUS I (QUOTIENT V W)))),
which simplifies, applying TIMES-COMMUTES1 and DIFFERENCE-PLUS-CANCELLATION3,
and opening up the functions ZEROP, NOT, IMPLIES, TIMES, QUOTIENT, and PLUS,
to the new formula:
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(EQUAL (QUOTIENT (PLUS V (TIMES W (SUB1 I)))
W)
(PLUS (SUB1 I) (QUOTIENT V W)))
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP (PLUS V W (TIMES W (SUB1 I)))
W))
(EQUAL 0
(ADD1 (PLUS (SUB1 I) (QUOTIENT V W))))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-PLUS-TIMES
(DEFN LEN
(X)
(IF (NLISTP X)
0
(ADD1 (LEN (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, LEN is
accepted under the principle of definition. From the definition we can
conclude that (NUMBERP (LEN X)) is a theorem.
[ 0.0 0.0 0.0 ]
LEN
(PROVE-LEMMA EQUAL-LEN-0
(REWRITE)
(EQUAL (EQUAL (LEN X) 0) (NLISTP X)))
This formula simplifies, opening up the definition of NLISTP, to two new
conjectures:
Case 2. (IMPLIES (NOT (EQUAL (LEN X) 0))
(LISTP X)),
which again simplifies, unfolding the definitions of LEN and EQUAL, to:
T.
Case 1. (IMPLIES (EQUAL (LEN X) 0)
(NOT (LISTP X))),
which we will name *1.
Perhaps we can prove it by induction. There is only one plausible
induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP X) (p X))
(IMPLIES (AND (NOT (NLISTP X)) (p (CDR X)))
(p X))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP 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 produces three new formulas:
Case 3. (IMPLIES (AND (NLISTP X) (EQUAL (LEN X) 0))
(NOT (LISTP X))),
which simplifies, opening up NLISTP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP X))
(NOT (EQUAL (LEN (CDR X)) 0))
(EQUAL (LEN X) 0))
(NOT (LISTP X))),
which simplifies, opening up NLISTP and LEN, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP X))
(NOT (LISTP (CDR X)))
(EQUAL (LEN X) 0))
(NOT (LISTP X))),
which simplifies, expanding the definitions of NLISTP and LEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-LEN-0
(DEFN APP
(X Y)
(IF (NLISTP X)
Y
(CONS (CAR X) (APP (CDR X) Y))))
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, APP is
accepted under the definitional principle. From the definition we can
conclude that (OR (LISTP (APP X Y)) (EQUAL (APP X Y) Y)) is a theorem.
[ 0.0 0.0 0.0 ]
APP
(PROVE-LEMMA APP-CANCELLATION
(REWRITE)
(EQUAL (EQUAL (APP A B) (APP A C))
(EQUAL B C)))
This simplifies, obviously, to two new formulas:
Case 2. (IMPLIES (NOT (EQUAL B C))
(NOT (EQUAL (APP A B) (APP A C)))),
which we will name *1.
Case 1. (IMPLIES (EQUAL B C)
(EQUAL (EQUAL (APP A B) (APP A C))
T)).
This again simplifies, opening up the definition of EQUAL, to:
T.
So next consider:
(IMPLIES (NOT (EQUAL B C))
(NOT (EQUAL (APP A B) (APP A C)))),
which we named *1 above. Let us appeal to the induction principle. Two
inductions are suggested by terms in the conjecture. However, they merge into
one likely candidate induction. We will induct according to the following
scheme:
(AND (IMPLIES (NLISTP A) (p A B C))
(IMPLIES (AND (NOT (NLISTP A)) (p (CDR A) B C))
(p A B C))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP 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 two new goals:
Case 2. (IMPLIES (AND (NLISTP A) (NOT (EQUAL B C)))
(NOT (EQUAL (APP A B) (APP A C)))),
which simplifies, opening up the functions NLISTP and APP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP A))
(NOT (EQUAL (APP (CDR A) B)
(APP (CDR A) C)))
(NOT (EQUAL B C)))
(NOT (EQUAL (APP A B) (APP A C)))),
which simplifies, applying the lemmas CAR-CONS and CDR-CONS, and opening up
NLISTP and APP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
APP-CANCELLATION
(PROVE-LEMMA APP-ASSOC
(REWRITE)
(EQUAL (APP (APP A B) C)
(APP A (APP B C))))
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 (NLISTP A) (p A B C))
(IMPLIES (AND (NOT (NLISTP A)) (p (CDR A) B C))
(p A B C))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to prove that the measure (COUNT A) decreases according to
the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme leads to two new goals:
Case 2. (IMPLIES (NLISTP A)
(EQUAL (APP (APP A B) C)
(APP A (APP B C)))),
which simplifies, opening up the definitions of NLISTP and APP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP A))
(EQUAL (APP (APP (CDR A) B) C)
(APP (CDR A) (APP B C))))
(EQUAL (APP (APP A B) C)
(APP A (APP B C)))),
which simplifies, applying CDR-CONS and CAR-CONS, and unfolding NLISTP and
APP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
APP-ASSOC
(PROVE-LEMMA LEN-APP
(REWRITE)
(EQUAL (LEN (APP A B))
(PLUS (LEN A) (LEN B))))
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 (NLISTP A) (p A B))
(IMPLIES (AND (NOT (NLISTP A)) (p (CDR A) B))
(p A B))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to prove that the measure (COUNT A) decreases according to
the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme leads to two new goals:
Case 2. (IMPLIES (NLISTP A)
(EQUAL (LEN (APP A B))
(PLUS (LEN A) (LEN B)))),
which simplifies, opening up the definitions of NLISTP, APP, LEN, EQUAL, and
PLUS, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP A))
(EQUAL (LEN (APP (CDR A) B))
(PLUS (LEN (CDR A)) (LEN B))))
(EQUAL (LEN (APP A B))
(PLUS (LEN A) (LEN B)))),
which simplifies, applying PLUS-COMMUTES1, CDR-CONS, and PLUS-ADD1, and
unfolding NLISTP, APP, and LEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LEN-APP
(PROVE-LEMMA QUOTIENT-X-X
(REWRITE)
(IMPLIES (NOT (ZEROP X))
(EQUAL (QUOTIENT X X) 1)))
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, rewriting with the lemma DIFFERENCE-IS-0, and expanding the
functions QUOTIENT, LESSP, EQUAL, and ADD1, 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 NOT-LESSP-TIMES-QUOTIENT
(REWRITE)
(NOT (LESSP N (TIMES W (QUOTIENT N W)))))
WARNING: Note that the proposed lemma NOT-LESSP-TIMES-QUOTIENT is to be
stored as zero type prescription rules, zero compound recognizer rules, one
linear rule, and zero replacement rules.
.
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace N by (PLUS Z (TIMES W X))
to eliminate (QUOTIENT N W) and (REMAINDER N W). We use 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 two new goals:
Case 2. (IMPLIES (NOT (NUMBERP N))
(NOT (LESSP N (TIMES W (QUOTIENT N W))))).
This simplifies, rewriting with TIMES-COMMUTES1, and expanding LESSP,
QUOTIENT, EQUAL, and TIMES, to:
T.
Case 1. (IMPLIES (AND (NUMBERP X)
(NUMBERP Z)
(EQUAL (LESSP Z W) (NOT (ZEROP W))))
(NOT (LESSP (PLUS Z (TIMES W X))
(TIMES W X)))).
However this simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NOT-LESSP-TIMES-QUOTIENT
(PROVE-LEMMA TIMES-MONOTONIC
(REWRITE)
(IMPLIES (AND (NOT (ZEROP W)) (LESSP A B))
(LESSP (TIMES W A) (TIMES W B))))
WARNING: When the linear lemma TIMES-MONOTONIC is stored under (TIMES W B) it
contains the free variable A which will be chosen by instantiating the
hypothesis (LESSP A B).
WARNING: When the linear lemma TIMES-MONOTONIC is stored under (TIMES W A) it
contains the free variable B which will be chosen by instantiating the
hypothesis (LESSP A B).
WARNING: Note that the proposed lemma TIMES-MONOTONIC is to be stored as zero
type prescription rules, zero compound recognizer rules, two linear rules, and
zero replacement rules.
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to:
(IMPLIES (AND (NOT (EQUAL W 0))
(NUMBERP W)
(LESSP A B))
(LESSP (TIMES W A) (TIMES W B))).
This simplifies, applying TIMES-COMMUTES1, to the formula:
(IMPLIES (AND (NOT (EQUAL W 0))
(NUMBERP W)
(LESSP A B))
(LESSP (TIMES A W) (TIMES B W))).
Give the above formula the name *1.
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 (OR (EQUAL B 0) (NOT (NUMBERP B)))
(p A W B))
(IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(OR (EQUAL A 0) (NOT (NUMBERP A))))
(p A W B))
(IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(p (SUB1 A) W (SUB1 B)))
(p A W B))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT inform us that the measure (COUNT A) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for B. The above induction scheme
leads to the following four new conjectures:
Case 4. (IMPLIES (AND (OR (EQUAL B 0) (NOT (NUMBERP B)))
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP A B))
(LESSP (TIMES A W) (TIMES B W))).
This simplifies, expanding the definitions of 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)))
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP A B))
(LESSP (TIMES A W) (TIMES B W))).
This simplifies, unfolding NOT, OR, EQUAL, LESSP, and TIMES, to the
following two new formulas:
Case 3.2.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(EQUAL A 0)
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (EQUAL (PLUS W (TIMES (SUB1 B) W))
0))).
However this again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (NUMBERP A))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (EQUAL (PLUS W (TIMES (SUB1 B) W))
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (LESSP (SUB1 A) (SUB1 B)))
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP A B))
(LESSP (TIMES A W) (TIMES B W))),
which simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP A 1)
(NOT (OR (EQUAL B 0) (NOT (NUMBERP B))))
(NOT (OR (EQUAL A 0) (NOT (NUMBERP A))))
(NOT (LESSP (SUB1 A) (SUB1 B)))
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP A B))
(LESSP (TIMES A W) (TIMES B W))).
This 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 (TIMES (SUB1 A) W)
(TIMES (SUB1 B) W))
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP A B))
(LESSP (TIMES A W) (TIMES B W))),
which simplifies, opening up the definitions of NOT, OR, LESSP, and TIMES,
to:
(IMPLIES (AND (NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL A 0))
(NUMBERP A)
(LESSP (TIMES (SUB1 A) W)
(TIMES (SUB1 B) W))
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP (SUB1 A) (SUB1 B)))
(LESSP (PLUS W (TIMES (SUB1 A) W))
(PLUS W (TIMES (SUB1 B) W)))).
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-MONOTONIC
(PROVE-LEMMA DIFFERENCE-PLUS
(REWRITE)
(EQUAL (DIFFERENCE (PLUS X Y) Y)
(FIX X)))
This conjecture simplifies, opening up the function FIX, to the following two
new goals:
Case 2. (IMPLIES (NOT (NUMBERP X))
(EQUAL (DIFFERENCE (PLUS X Y) Y) 0)).
But this again simplifies, expanding the definition of PLUS, to two new
conjectures:
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP X))
(NOT (NUMBERP Y)))
(EQUAL (DIFFERENCE 0 Y) 0)),
which again simplifies, using linear arithmetic, rewriting with
DIFFERENCE-IS-0, and expanding the definition of EQUAL, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP X)) (NUMBERP Y))
(EQUAL (DIFFERENCE Y Y) 0)).
However this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP Y Y)
(NOT (NUMBERP X))
(NUMBERP Y))
(EQUAL (DIFFERENCE Y Y) 0)).
But this again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (NUMBERP X)
(EQUAL (DIFFERENCE (PLUS X Y) Y) X)),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP (PLUS X Y) Y) (NUMBERP X))
(EQUAL (DIFFERENCE (PLUS X Y) Y) X)).
But this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-PLUS
(PROVE-LEMMA NSIG*-ALG-LEMMA-HACK1
(REWRITE)
(IMPLIES (AND (LESSP N (QUOTIENT (PLUS R X) W))
(NUMBERP W)
(NOT (EQUAL W 0)))
(EQUAL (LESSP (PLUS TS (TIMES N W))
(PLUS R TS X))
T))
((DISABLE TIMES-MONOTONIC)
(USE (TIMES-MONOTONIC (A N)
(B (QUOTIENT (PLUS R X) W))))))
This formula simplifies, rewriting with TIMES-COMMUTES1, and unfolding ZEROP,
NOT, AND, and IMPLIES, to the goal:
(IMPLIES (AND (LESSP (TIMES N W)
(TIMES W (QUOTIENT (PLUS R X) W)))
(LESSP N (QUOTIENT (PLUS R X) W))
(NUMBERP W)
(NOT (EQUAL W 0)))
(LESSP (PLUS TS (TIMES N W))
(PLUS R TS X))).
This again simplifies, using linear arithmetic and applying
NOT-LESSP-TIMES-QUOTIENT, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NSIG*-ALG-LEMMA-HACK1
(PROVE-LEMMA DIFFERENCE-PLUS-CANCELLATION-4
(REWRITE)
(EQUAL (DIFFERENCE (PLUS R TS X) (PLUS TS Y))
(DIFFERENCE (PLUS R X) Y)))
This simplifies, using linear arithmetic, to the following two new goals:
Case 2. (IMPLIES (LESSP (PLUS R TS X) (PLUS TS Y))
(EQUAL (DIFFERENCE (PLUS R TS X) (PLUS TS Y))
(DIFFERENCE (PLUS R X) Y))).
However this again simplifies, using linear arithmetic, rewriting with the
lemma DIFFERENCE-IS-0, and opening up the function EQUAL, to:
T.
Case 1. (IMPLIES (LESSP (PLUS R X) Y)
(EQUAL (DIFFERENCE (PLUS R TS X) (PLUS TS Y))
(DIFFERENCE (PLUS R X) Y))),
which again simplifies, using linear arithmetic, applying the lemma
DIFFERENCE-IS-0, and opening up the definition of EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-PLUS-CANCELLATION-4
(PROVE-LEMMA NTS*-ALG-LEMMA2-HACK1
(REWRITE)
(IMPLIES
(AND (LESSP N (QUOTIENT (PLUS R X) W))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (TIMES N W) (PLUS R X)))
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP X W))
(EQUAL (EQUAL (QUOTIENT (PLUS R X) W)
(QUOTIENT (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
W))
T))
((DISABLE TIMES-MONOTONIC)
(USE (TIMES-MONOTONIC (A N)
(B (QUOTIENT (PLUS R X) W))
(W W)))))
This conjecture simplifies, rewriting with TIMES-COMMUTES1, and opening up
ZEROP, NOT, AND, and IMPLIES, to the new conjecture:
(IMPLIES
(AND (LESSP (TIMES N W)
(TIMES W (QUOTIENT (PLUS R X) W)))
(LESSP N (QUOTIENT (PLUS R X) W))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (TIMES N W) (PLUS R X)))
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP X W))
(EQUAL (QUOTIENT (PLUS R X) W)
(QUOTIENT (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
W))),
which again simplifies, using linear arithmetic and rewriting with the lemma
NOT-LESSP-TIMES-QUOTIENT, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NTS*-ALG-LEMMA2-HACK1
(PROVE-LEMMA TIMES-CANCELLATION1
(REWRITE)
(IMPLIES (NOT (ZEROP I))
(EQUAL (EQUAL (TIMES I J) (TIMES I K))
(EQUAL (FIX J) (FIX K))))
((INDUCT (LESSP J K))))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to three new conjectures:
Case 3. (IMPLIES (AND (OR (EQUAL K 0) (NOT (NUMBERP K)))
(NOT (EQUAL I 0))
(NUMBERP I))
(EQUAL (EQUAL (TIMES I J) (TIMES I K))
(EQUAL (FIX J) (FIX K)))),
which simplifies, rewriting with TIMES-COMMUTES1 and TIMES-NON-NUMBERP, and
opening up the functions NOT, OR, EQUAL, TIMES, and FIX, to the following
six new formulas:
Case 3.6.
(IMPLIES (AND (EQUAL K 0)
(NOT (EQUAL I 0))
(NUMBERP I)
(NUMBERP J)
(NOT (EQUAL J 0)))
(NOT (EQUAL (TIMES I J) 0))).
This again simplifies, obviously, to:
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(NUMBERP J)
(NOT (EQUAL J 0)))
(NOT (EQUAL (TIMES I J) 0))),
which we will name *1.
Case 3.5.
(IMPLIES (AND (EQUAL K 0)
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (NUMBERP J)))
(EQUAL (EQUAL (TIMES I J) 0) T)).
However this again simplifies, rewriting with the lemma TIMES-NON-NUMBERP,
and expanding the definition of EQUAL, to:
T.
Case 3.4.
(IMPLIES (AND (EQUAL K 0)
(NOT (EQUAL I 0))
(NUMBERP I)
(EQUAL J 0))
(EQUAL (EQUAL (TIMES I J) 0) T)),
which again simplifies, rewriting with TIMES-COMMUTES1, and expanding the
definitions of EQUAL and TIMES, to:
T.
Case 3.3.
(IMPLIES (AND (NOT (NUMBERP K))
(NOT (EQUAL I 0))
(NUMBERP I)
(NUMBERP J)
(NOT (EQUAL J 0)))
(NOT (EQUAL (TIMES I J) 0))).
Name the above subgoal *2.
Case 3.2.
(IMPLIES (AND (NOT (NUMBERP K))
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (NUMBERP J)))
(EQUAL (EQUAL (TIMES I J) 0) T)).
But this again simplifies, rewriting with the lemma TIMES-NON-NUMBERP, and
opening up the function EQUAL, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (NUMBERP K))
(NOT (EQUAL I 0))
(NUMBERP I)
(EQUAL J 0))
(EQUAL (EQUAL (TIMES I J) 0) T)),
which again simplifies, rewriting with TIMES-COMMUTES1, and expanding the
definitions of EQUAL and TIMES, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL K 0))
(NUMBERP K)
(OR (EQUAL J 0) (NOT (NUMBERP J)))
(NOT (EQUAL I 0))
(NUMBERP I))
(EQUAL (EQUAL (TIMES I J) (TIMES I K))
(EQUAL (FIX J) (FIX K)))).
This simplifies, applying TIMES-COMMUTES1 and TIMES-NON-NUMBERP, and
expanding the definitions of NOT, OR, EQUAL, TIMES, and FIX, to two new
formulas:
Case 2.2.
(IMPLIES (AND (NOT (EQUAL K 0))
(NUMBERP K)
(EQUAL J 0)
(NOT (EQUAL I 0))
(NUMBERP I))
(NOT (EQUAL 0 (TIMES I K)))),
which again simplifies, clearly, to:
(IMPLIES (AND (NOT (EQUAL K 0))
(NUMBERP K)
(NOT (EQUAL I 0))
(NUMBERP I))
(NOT (EQUAL 0 (TIMES I K)))),
which we will name *3.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL K 0))
(NUMBERP K)
(NOT (NUMBERP J))
(NOT (EQUAL I 0))
(NUMBERP I))
(NOT (EQUAL 0 (TIMES I K)))).
Give the above formula the name *4.
Case 1. (IMPLIES (AND (NOT (EQUAL K 0))
(NUMBERP K)
(NOT (EQUAL J 0))
(NUMBERP J)
(IMPLIES (NOT (ZEROP I))
(EQUAL (EQUAL (TIMES I (SUB1 J))
(TIMES I (SUB1 K)))
(EQUAL (FIX (SUB1 J))
(FIX (SUB1 K)))))
(NOT (EQUAL I 0))
(NUMBERP I))
(EQUAL (EQUAL (TIMES I J) (TIMES I K))
(EQUAL (FIX J) (FIX K)))).
This simplifies, unfolding ZEROP, NOT, FIX, and IMPLIES, to the following
four new conjectures:
Case 1.4.
(IMPLIES (AND (NOT (EQUAL K 0))
(NUMBERP K)
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (EQUAL (SUB1 J) (SUB1 K)))
(NOT (EQUAL (TIMES I (SUB1 J))
(TIMES I (SUB1 K))))
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL J K)))
(NOT (EQUAL (TIMES I J) (TIMES I K)))).
Appealing to the lemma SUB1-ELIM, we now replace J by (ADD1 X) to
eliminate (SUB1 J). We employ the type restriction lemma noted when SUB1
was introduced to constrain the new variable. The result is:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL K 0))
(NUMBERP K)
(NOT (EQUAL (ADD1 X) 0))
(NOT (EQUAL X (SUB1 K)))
(NOT (EQUAL (TIMES I X)
(TIMES I (SUB1 K))))
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL (ADD1 X) K)))
(NOT (EQUAL (TIMES I (ADD1 X))
(TIMES I K)))).
However this further simplifies, applying TIMES-ADD1, to:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL K 0))
(NUMBERP K)
(NOT (EQUAL X (SUB1 K)))
(NOT (EQUAL (TIMES I X)
(TIMES I (SUB1 K))))
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL (ADD1 X) K)))
(NOT (EQUAL (PLUS I (TIMES I X))
(TIMES I K)))).
Applying the lemma SUB1-ELIM, replace K by (ADD1 Z) to eliminate (SUB1 K).
We rely upon the type restriction lemma noted when SUB1 was introduced to
restrict the new variable. We thus obtain:
(IMPLIES (AND (NUMBERP Z)
(NUMBERP X)
(NOT (EQUAL (ADD1 Z) 0))
(NOT (EQUAL X Z))
(NOT (EQUAL (TIMES I X) (TIMES I Z)))
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL (ADD1 X) (ADD1 Z))))
(NOT (EQUAL (PLUS I (TIMES I X))
(TIMES I (ADD1 Z))))),
which further simplifies, applying ADD1-EQUAL and TIMES-ADD1, to:
(IMPLIES (AND (NUMBERP Z)
(NUMBERP X)
(NOT (EQUAL X Z))
(NOT (EQUAL (TIMES I X) (TIMES I Z)))
(NOT (EQUAL I 0))
(NUMBERP I))
(NOT (EQUAL (PLUS I (TIMES I X))
(PLUS I (TIMES I Z))))),
which finally simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL K 0))
(NUMBERP K)
(NOT (EQUAL J 0))
(NUMBERP J)
(NOT (EQUAL (SUB1 J) (SUB1 K)))
(NOT (EQUAL (TIMES I (SUB1 J))
(TIMES I (SUB1 K))))
(NOT (EQUAL I 0))
(NUMBERP I)
(EQUAL J K))
(EQUAL (EQUAL (TIMES I J) (TIMES I K))
T)),
which again simplifies, clearly, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL K 0))
(NUMBERP K)
(NOT (EQUAL J 0))
(NUMBERP J)
(EQUAL (SUB1 J) (SUB1 K))
(EQUAL (EQUAL (TIMES I (SUB1 J))
(TIMES I (SUB1 K)))
T)
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL J K)))
(NOT (EQUAL (TIMES I J) (TIMES I K)))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL K 0))
(NUMBERP K)
(NOT (EQUAL J 0))
(NUMBERP J)
(EQUAL (SUB1 J) (SUB1 K))
(EQUAL (EQUAL (TIMES I (SUB1 J))
(TIMES I (SUB1 K)))
T)
(NOT (EQUAL I 0))
(NUMBERP I)
(EQUAL J K))
(EQUAL (EQUAL (TIMES I J) (TIMES I K))
T)),
which again simplifies, unfolding the function EQUAL, to:
T.
So next consider:
(IMPLIES (AND (NOT (EQUAL K 0))
(NUMBERP K)
(NOT (NUMBERP J))
(NOT (EQUAL I 0))
(NUMBERP I))
(NOT (EQUAL 0 (TIMES I K)))),
which is formula *4 above. Ah ha! This conjecture is subsumed by another
subgoal awaiting our attention, namely *3 above.
So let us turn our attention to:
(IMPLIES (AND (NOT (EQUAL K 0))
(NUMBERP K)
(NOT (EQUAL I 0))
(NUMBERP I))
(NOT (EQUAL 0 (TIMES I K)))),
which we named *3 above. Ah ha! This conjecture is subsumed by formula *1
above.
So let us turn our attention to:
(IMPLIES (AND (NOT (NUMBERP K))
(NOT (EQUAL I 0))
(NUMBERP I)
(NUMBERP J)
(NOT (EQUAL J 0)))
(NOT (EQUAL (TIMES I J) 0))),
named *2 above. Ah ha! This conjecture is subsumed by another subgoal
awaiting our attention, namely *1 above.
So next consider:
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(NUMBERP J)
(NOT (EQUAL J 0)))
(NOT (EQUAL (TIMES I J) 0))),
named *1 above. 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 I) (p I J))
(IMPLIES (AND (NOT (ZEROP I)) (p (SUB1 I) J))
(p I J))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT I) decreases according to the well-founded relation
LESSP in each induction step of the scheme. The above induction scheme leads
to three new formulas:
Case 3. (IMPLIES (AND (ZEROP I)
(NOT (EQUAL I 0))
(NUMBERP I)
(NUMBERP J)
(NOT (EQUAL J 0)))
(NOT (EQUAL (TIMES I J) 0))),
which simplifies, opening up ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP I))
(EQUAL (SUB1 I) 0)
(NOT (EQUAL I 0))
(NUMBERP I)
(NUMBERP J)
(NOT (EQUAL J 0)))
(NOT (EQUAL (TIMES I J) 0))),
which simplifies, opening up the definitions of ZEROP and TIMES, to:
(IMPLIES (AND (EQUAL (SUB1 I) 0)
(NOT (EQUAL I 0))
(NUMBERP I)
(NUMBERP J)
(NOT (EQUAL J 0)))
(NOT (EQUAL (PLUS J (TIMES (SUB1 I) J))
0))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP I))
(NOT (EQUAL (TIMES (SUB1 I) J) 0))
(NOT (EQUAL I 0))
(NUMBERP I)
(NUMBERP J)
(NOT (EQUAL J 0)))
(NOT (EQUAL (TIMES I J) 0))),
which simplifies, unfolding ZEROP and TIMES, to:
(IMPLIES (AND (NOT (EQUAL (TIMES (SUB1 I) J) 0))
(NOT (EQUAL I 0))
(NUMBERP I)
(NUMBERP J)
(NOT (EQUAL J 0)))
(NOT (EQUAL (PLUS J (TIMES (SUB1 I) J))
0))).
This again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-CANCELLATION1
(PROVE-LEMMA TIMES-CANCELLATION2
(REWRITE)
(IMPLIES (NOT (ZEROP W))
(EQUAL (EQUAL (PLUS (TIMES W X) (TIMES W Y))
(TIMES W Z))
(EQUAL (PLUS X Y) (FIX Z))))
((DISABLE TIMES-CANCELLATION1)
(USE (TIMES-CANCELLATION1 (I W)
(J (PLUS X Y))
(K Z)))))
This formula can be simplified, using the abbreviations ZEROP, NOT, and
IMPLIES, to:
(IMPLIES (AND (IMPLIES (NOT (ZEROP W))
(EQUAL (EQUAL (TIMES W (PLUS X Y))
(TIMES W Z))
(EQUAL (FIX (PLUS X Y)) (FIX Z))))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (EQUAL (PLUS (TIMES W X) (TIMES W Y))
(TIMES W Z))
(EQUAL (PLUS X Y) (FIX Z)))),
which simplifies, applying TIMES-DISTRIBUTES1 and TIMES-NON-NUMBERP, and
unfolding the definitions of ZEROP, NOT, FIX, IMPLIES, and EQUAL, to the
following two new formulas:
Case 2. (IMPLIES (AND (NOT (NUMBERP Z))
(NOT (EQUAL (PLUS X Y) 0))
(NOT (EQUAL (PLUS (TIMES W X) (TIMES W Y))
(TIMES W Z)))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (EQUAL (PLUS (TIMES W X) (TIMES W Y))
0))).
But this again simplifies, applying TIMES-NON-NUMBERP, and opening up EQUAL,
to:
T.
Case 1. (IMPLIES (AND (NOT (NUMBERP Z))
(EQUAL (PLUS X Y) 0)
(EQUAL (EQUAL (PLUS (TIMES W X) (TIMES W Y))
(TIMES W Z))
T)
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (PLUS (TIMES W X) (TIMES W Y))
0)).
But this again simplifies, applying TIMES-NON-NUMBERP, and expanding EQUAL,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TIMES-CANCELLATION2
(PROVE-LEMMA DIFFERENCE-DIFFERENCE
(REWRITE)
(IMPLIES (NOT (LESSP B C))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
(DIFFERENCE (PLUS A C) B))))
This formula simplifies, using linear arithmetic, to the following two new
formulas:
Case 2. (IMPLIES (AND (LESSP A (DIFFERENCE B C))
(NOT (LESSP B C)))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
(DIFFERENCE (PLUS A C) B))).
However this again simplifies, using linear arithmetic, applying
DIFFERENCE-IS-0, and unfolding the function EQUAL, to:
T.
Case 1. (IMPLIES (AND (LESSP (PLUS A C) B)
(NOT (LESSP B C)))
(EQUAL (DIFFERENCE A (DIFFERENCE B C))
(DIFFERENCE (PLUS A C) B))).
But this again simplifies, using linear arithmetic, rewriting with
DIFFERENCE-IS-0, and opening up the function EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-DIFFERENCE
(PROVE-LEMMA DIFFERENCE-DIFFERENCE-OTHER
(REWRITE)
(EQUAL (DIFFERENCE (DIFFERENCE A B) C)
(DIFFERENCE A (PLUS B C))))
This simplifies, using linear arithmetic, to the following three new
conjectures:
Case 3. (IMPLIES (LESSP (DIFFERENCE A B) C)
(EQUAL (DIFFERENCE (DIFFERENCE A B) C)
(DIFFERENCE A (PLUS B C)))).
But this again simplifies, using linear arithmetic, applying DIFFERENCE-IS-0,
and opening up the function EQUAL, to:
(IMPLIES (AND (LESSP (DIFFERENCE A B) C)
(LESSP A B))
(EQUAL (DIFFERENCE (DIFFERENCE A B) C)
(DIFFERENCE A (PLUS B C)))),
which again simplifies, using linear arithmetic, applying the lemma
DIFFERENCE-IS-0, and expanding EQUAL and LESSP, to:
T.
Case 2. (IMPLIES (LESSP A B)
(EQUAL (DIFFERENCE (DIFFERENCE A B) C)
(DIFFERENCE A (PLUS B C)))),
which again simplifies, using linear arithmetic, applying the lemma
DIFFERENCE-IS-0, and opening up the function EQUAL, to:
T.
Case 1. (IMPLIES (LESSP A (PLUS B C))
(EQUAL (DIFFERENCE (DIFFERENCE A B) C)
(DIFFERENCE A (PLUS B C)))),
which again simplifies, using linear arithmetic, applying the lemma
DIFFERENCE-IS-0, and opening up EQUAL, to:
(IMPLIES (AND (LESSP A (PLUS B C)) (LESSP A B))
(EQUAL (DIFFERENCE (DIFFERENCE A B) C)
(DIFFERENCE A (PLUS B C)))).
But this again simplifies, using linear arithmetic, rewriting with the lemma
DIFFERENCE-IS-0, and expanding the definition of EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-DIFFERENCE-OTHER
(PROVE-LEMMA QUOTIENT-PLUS-TIMES2
(REWRITE)
(IMPLIES (NOT (ZEROP W))
(EQUAL (QUOTIENT (PLUS V (TIMES I W) (TIMES W J))
W)
(PLUS I J (QUOTIENT V W))))
((DISABLE QUOTIENT-PLUS-TIMES)
(USE (QUOTIENT-PLUS-TIMES (I (PLUS I J))))))
This formula can be simplified, using the abbreviations ZEROP, NOT, IMPLIES,
and PLUS-ASSOCIATES, to:
(IMPLIES (AND (IMPLIES (NOT (ZEROP W))
(EQUAL (QUOTIENT (PLUS V (TIMES W (PLUS I J)))
W)
(PLUS I J (QUOTIENT V W))))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (QUOTIENT (PLUS V (TIMES I W) (TIMES W J))
W)
(PLUS I J (QUOTIENT V W)))),
which simplifies, applying TIMES-COMMUTES1 and TIMES-DISTRIBUTES1, and
unfolding the definitions of ZEROP, NOT, and IMPLIES, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-PLUS-TIMES2
(PROVE-LEMMA DIFFERENCE-ELIM
(ELIM)
(IMPLIES (AND (NUMBERP I) (NOT (LESSP I J)))
(EQUAL (PLUS J (DIFFERENCE I J)) I)))
This conjecture simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DIFFERENCE-ELIM
(PROVE-LEMMA QUOTIENT-DIFFERENCE
(REWRITE)
(IMPLIES (AND (NOT (ZEROP W))
(NOT (LESSP A (TIMES W B))))
(EQUAL (QUOTIENT (DIFFERENCE A (TIMES W B))
W)
(DIFFERENCE (QUOTIENT A W) B))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to the formula:
(IMPLIES (AND (NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP A (TIMES W B))))
(EQUAL (QUOTIENT (DIFFERENCE A (TIMES W B))
W)
(DIFFERENCE (QUOTIENT A W) B))).
This simplifies, applying TIMES-COMMUTES1, to the formula:
(IMPLIES (AND (NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP A (TIMES B W))))
(EQUAL (QUOTIENT (DIFFERENCE A (TIMES B W))
W)
(DIFFERENCE (QUOTIENT A W) B))).
Appealing to the lemmas DIFFERENCE-ELIM and REMAINDER-QUOTIENT-ELIM, we now
replace A by (PLUS (TIMES B W) X) to eliminate (DIFFERENCE A (TIMES B W)) and
X by (PLUS V (TIMES W Z)) to eliminate (QUOTIENT X W) and (REMAINDER X W). 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
constrain the new variables. This generates two new goals:
Case 2. (IMPLIES (AND (NOT (NUMBERP A))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP A (TIMES B W))))
(EQUAL (QUOTIENT (DIFFERENCE A (TIMES B W))
W)
(DIFFERENCE (QUOTIENT A W) B))),
which further simplifies, using linear arithmetic, rewriting with
DIFFERENCE-IS-0, and opening up the functions LESSP, EQUAL, and QUOTIENT, to:
T.
Case 1. (IMPLIES (AND (NUMBERP Z)
(NUMBERP V)
(EQUAL (LESSP V W) (NOT (ZEROP W)))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS (TIMES B W) V (TIMES W Z))
(TIMES B W))))
(EQUAL Z
(DIFFERENCE (QUOTIENT (PLUS (TIMES B W) V (TIMES W Z))
W)
B))).
However this further simplifies, rewriting with the lemmas PLUS-COMMUTES2,
PLUS-COMMUTES1, QUOTIENT-PLUS-TIMES2, and DIFFERENCE-PLUS-CANCELLATION1, and
expanding the functions ZEROP, NOT, QUOTIENT, EQUAL, and PLUS, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-DIFFERENCE
(PROVE-LEMMA QUOTIENT-MONOTONIC-LEMMA
(REWRITE)
(IMPLIES (AND (LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP X V))
(EQUAL (LESSP (PLUS Z1 (TIMES Y X))
(PLUS Z2 (TIMES V Y)))
T))
((INDUCT (LESSP X V))))
This conjecture can be simplified, using the abbreviations IMPLIES, NOT, OR,
and AND, to three new conjectures:
Case 3. (IMPLIES (AND (OR (EQUAL V 0) (NOT (NUMBERP V)))
(LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP X V))
(EQUAL (LESSP (PLUS Z1 (TIMES Y X))
(PLUS Z2 (TIMES V Y)))
T)),
which simplifies, opening up the functions NOT, OR, EQUAL, and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL V 0))
(NUMBERP V)
(OR (EQUAL X 0) (NOT (NUMBERP X)))
(LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP X V))
(EQUAL (LESSP (PLUS Z1 (TIMES Y X))
(PLUS Z2 (TIMES V Y)))
T)),
which simplifies, appealing to the lemmas TIMES-COMMUTES1 and PLUS-COMMUTES1,
and opening up the definitions of NOT, OR, EQUAL, LESSP, TIMES, and PLUS, to
four new formulas:
Case 2.4.
(IMPLIES (AND (NOT (EQUAL V 0))
(NUMBERP V)
(EQUAL X 0)
(LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (NUMBERP Z1)))
(LESSP 0 (PLUS Z2 (TIMES V Y)))),
which again simplifies, using linear arithmetic and rewriting with
TIMES-MONOTONIC and TIMES-NON-NUMBERP, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (EQUAL V 0))
(NUMBERP V)
(EQUAL X 0)
(LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP Z1))
(LESSP Z1 (PLUS Z2 (TIMES V Y)))).
This again simplifies, obviously, to the new formula:
(IMPLIES (AND (NOT (EQUAL V 0))
(NUMBERP V)
(LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP Z1))
(LESSP Z1 (PLUS Z2 (TIMES V Y)))),
which we will name *1.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL V 0))
(NUMBERP V)
(NOT (NUMBERP X))
(LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NOT (NUMBERP Z1)))
(LESSP 0 (PLUS Z2 (TIMES V Y)))).
This again simplifies, using linear arithmetic and rewriting with
TIMES-MONOTONIC and TIMES-NON-NUMBERP, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL V 0))
(NUMBERP V)
(NOT (NUMBERP X))
(LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP Z1))
(LESSP Z1 (PLUS Z2 (TIMES V Y)))).
Name the above subgoal *2.
Case 1. (IMPLIES (AND (NOT (EQUAL V 0))
(NUMBERP V)
(NOT (EQUAL X 0))
(NUMBERP X)
(IMPLIES (AND (LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP (SUB1 X) (SUB1 V)))
(EQUAL (LESSP (PLUS Z1 (TIMES Y (SUB1 X)))
(PLUS Z2 (TIMES (SUB1 V) Y)))
T))
(LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP X V))
(EQUAL (LESSP (PLUS Z1 (TIMES Y X))
(PLUS Z2 (TIMES V Y)))
T)).
This simplifies, applying the lemmas TIMES-COMMUTES1 and PLUS-COMMUTES2, and
opening up NOT, AND, IMPLIES, LESSP, and TIMES, to the new goal:
(IMPLIES (AND (NOT (EQUAL V 0))
(NUMBERP V)
(NOT (EQUAL X 0))
(NUMBERP X)
(LESSP (PLUS Z1 (TIMES Y (SUB1 X)))
(PLUS Z2 (TIMES Y (SUB1 V))))
(LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(LESSP (SUB1 X) (SUB1 V)))
(LESSP (PLUS Y Z1 (TIMES Y (SUB1 X)))
(PLUS Y Z2 (TIMES Y (SUB1 V))))),
which again simplifies, using linear arithmetic, to:
T.
So next consider:
(IMPLIES (AND (NOT (EQUAL V 0))
(NUMBERP V)
(NOT (NUMBERP X))
(LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP Z1))
(LESSP Z1 (PLUS Z2 (TIMES V Y)))),
named *2 above. Ah ha! This conjecture is subsumed by another subgoal
awaiting our attention, namely *1 above.
So next consider:
(IMPLIES (AND (NOT (EQUAL V 0))
(NUMBERP V)
(LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP Z1))
(LESSP Z1 (PLUS Z2 (TIMES V Y)))),
which is formula *1 above. We will try to prove it by induction. There are
seven 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 V) (p Z1 Z2 V Y))
(IMPLIES (AND (NOT (ZEROP V))
(p Z1 Z2 (SUB1 V) Y))
(p Z1 Z2 V Y))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT V) decreases according to the well-founded
relation LESSP in each induction step of the scheme. The above induction
scheme leads to three new formulas:
Case 3. (IMPLIES (AND (ZEROP V)
(NOT (EQUAL V 0))
(NUMBERP V)
(LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP Z1))
(LESSP Z1 (PLUS Z2 (TIMES V Y)))),
which simplifies, unfolding the definition of ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP V))
(EQUAL (SUB1 V) 0)
(NOT (EQUAL V 0))
(NUMBERP V)
(LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP Z1))
(LESSP Z1 (PLUS Z2 (TIMES V Y)))),
which simplifies, applying PLUS-COMMUTES2, and opening up the definitions of
ZEROP and TIMES, to:
(IMPLIES (AND (EQUAL (SUB1 V) 0)
(NOT (EQUAL V 0))
(NUMBERP V)
(LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP Z1))
(LESSP Z1
(PLUS Y Z2 (TIMES (SUB1 V) Y)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP V))
(LESSP Z1
(PLUS Z2 (TIMES (SUB1 V) Y)))
(NOT (EQUAL V 0))
(NUMBERP V)
(LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP Z1))
(LESSP Z1 (PLUS Z2 (TIMES V Y)))),
which simplifies, rewriting with PLUS-COMMUTES2, and expanding the functions
ZEROP and TIMES, to:
(IMPLIES (AND (LESSP Z1
(PLUS Z2 (TIMES (SUB1 V) Y)))
(NOT (EQUAL V 0))
(NUMBERP V)
(LESSP Z1 Y)
(LESSP Z2 Y)
(NOT (EQUAL Y 0))
(NUMBERP Y)
(NUMBERP Z1))
(LESSP Z1
(PLUS Y Z2 (TIMES (SUB1 V) Y)))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-MONOTONIC-LEMMA
(PROVE-LEMMA NTR*-ALG-LEMMA2-HACK1
(REWRITE)
(IMPLIES (AND (LESSP N (QUOTIENT (PLUS R X) W))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS (TIMES N W))
(PLUS R TS X)))
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL (EQUAL (PLUS R TS X)
(PLUS TS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R))))
T))
((DISABLE TIMES-MONOTONIC)
(USE (TIMES-MONOTONIC (A N)
(B (QUOTIENT (PLUS R X) W))
(W W)))))
This conjecture simplifies, applying the lemmas TIMES-COMMUTES1 and
NSIG*-ALG-LEMMA-HACK1, and expanding the functions ZEROP, NOT, AND, and
IMPLIES, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NTR*-ALG-LEMMA2-HACK1
(PROVE-LEMMA NOT-LESSP-TIMES-QUOTIENT-OTHER
(REWRITE)
(IMPLIES (NOT (LESSP X R))
(NOT (LESSP (TIMES R (QUOTIENT X R)) R))))
WARNING: Note that the proposed lemma NOT-LESSP-TIMES-QUOTIENT-OTHER is to be
stored as zero type prescription rules, zero compound recognizer rules, one
linear rule, and zero replacement rules.
.
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace X by (PLUS V (TIMES R Z))
to eliminate (QUOTIENT X R) and (REMAINDER X R). 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 two new conjectures:
Case 2. (IMPLIES (AND (NOT (NUMBERP X))
(NOT (LESSP X R)))
(NOT (LESSP (TIMES R (QUOTIENT X R)) R))).
This simplifies, rewriting with TIMES-NON-NUMBERP and TIMES-COMMUTES1, and
opening up the definitions of LESSP, EQUAL, QUOTIENT, and TIMES, to:
T.
Case 1. (IMPLIES (AND (NUMBERP Z)
(NUMBERP V)
(EQUAL (LESSP V R) (NOT (ZEROP R)))
(NOT (LESSP (PLUS V (TIMES R Z)) R)))
(NOT (LESSP (TIMES R Z) R))).
This simplifies, applying the lemma PLUS-COMMUTES1, and unfolding ZEROP, NOT,
TIMES, EQUAL, PLUS, and LESSP, to:
(IMPLIES (AND (NUMBERP Z)
(NUMBERP V)
(NOT (EQUAL R 0))
(NUMBERP R)
(EQUAL (LESSP V R) T)
(NOT (LESSP (PLUS V (TIMES R Z)) R)))
(NOT (LESSP (TIMES R Z) R))).
This again simplifies, clearly, to:
(IMPLIES (AND (NUMBERP Z)
(NUMBERP V)
(NOT (EQUAL R 0))
(NUMBERP R)
(LESSP V R)
(NOT (LESSP (PLUS V (TIMES R Z)) R)))
(NOT (LESSP (TIMES R Z) R))),
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 (NOT (LESSP X R))
(NOT (LESSP (TIMES R (QUOTIENT X R)) R))).
We named this *1. We will try to prove it by induction. The recursive terms
in the conjecture suggest five inductions. They merge into two likely
candidate inductions. However, only one is unflawed. We will induct
according to the following scheme:
(AND (IMPLIES (ZEROP R) (p R X))
(IMPLIES (AND (NOT (ZEROP R)) (LESSP X R))
(p R X))
(IMPLIES (AND (NOT (ZEROP R))
(NOT (LESSP X R))
(p R (DIFFERENCE X R)))
(p R X))).
Linear arithmetic, the lemmas COUNT-NUMBERP and COUNT-NOT-LESSP, and the
definition of ZEROP inform us that the measure (COUNT X) decreases according
to the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme leads to three new formulas:
Case 3. (IMPLIES (AND (ZEROP R) (NOT (LESSP X R)))
(NOT (LESSP (TIMES R (QUOTIENT X R)) R))),
which simplifies, appealing to the lemmas TIMES-NON-NUMBERP and
TIMES-COMMUTES1, and expanding ZEROP, EQUAL, LESSP, QUOTIENT, and TIMES, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP R))
(LESSP (DIFFERENCE X R) R)
(NOT (LESSP X R)))
(NOT (LESSP (TIMES R (QUOTIENT X R)) R))),
which simplifies, rewriting with TIMES-ADD1, and unfolding the functions
ZEROP and QUOTIENT, to:
(IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(LESSP (DIFFERENCE X R) R)
(NOT (LESSP X R)))
(NOT (LESSP (PLUS R
(TIMES R
(QUOTIENT (DIFFERENCE X R) R)))
R))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP R))
(NOT (LESSP (TIMES R
(QUOTIENT (DIFFERENCE X R) R))
R))
(NOT (LESSP X R)))
(NOT (LESSP (TIMES R (QUOTIENT X R)) R))),
which simplifies, rewriting with the lemma TIMES-ADD1, and expanding the
definitions of ZEROP and QUOTIENT, to:
(IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (TIMES R
(QUOTIENT (DIFFERENCE X R) R))
R))
(NOT (LESSP X R)))
(NOT (LESSP (PLUS R
(TIMES R
(QUOTIENT (DIFFERENCE X R) R)))
R))).
But this again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
NOT-LESSP-TIMES-QUOTIENT-OTHER
(PROVE-LEMMA QUOTIENT-MONOTONIC
(REWRITE)
(IMPLIES (AND (NOT (ZEROP W))
(NOT (LESSP A B)))
(EQUAL (LESSP (QUOTIENT A W) (QUOTIENT B W))
F)))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP A B)))
(EQUAL (LESSP (QUOTIENT A W) (QUOTIENT B W))
F)),
which simplifies, obviously, to:
(IMPLIES (AND (NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP A B)))
(NOT (LESSP (QUOTIENT A W)
(QUOTIENT B W)))).
Applying the lemma REMAINDER-QUOTIENT-ELIM, replace A by (PLUS Z (TIMES W X))
to eliminate (QUOTIENT A W) and (REMAINDER A W). We use 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 two new formulas:
Case 2. (IMPLIES (AND (NOT (NUMBERP A))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP A B)))
(NOT (LESSP (QUOTIENT A W)
(QUOTIENT B W)))).
However this further simplifies, expanding LESSP, QUOTIENT, and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NUMBERP X)
(NUMBERP Z)
(EQUAL (LESSP Z W) (NOT (ZEROP W)))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS Z (TIMES W X)) B)))
(NOT (LESSP X (QUOTIENT B W)))),
which further simplifies, opening up ZEROP and NOT, to:
(IMPLIES (AND (NUMBERP X)
(NUMBERP Z)
(LESSP Z W)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS Z (TIMES W X)) B)))
(NOT (LESSP X (QUOTIENT B W)))).
Appealing to the lemma REMAINDER-QUOTIENT-ELIM, we now replace B by
(PLUS D (TIMES W V)) to eliminate (QUOTIENT B W) and (REMAINDER B W). 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 constrain the new variables. The result is two new goals:
Case 1.2.
(IMPLIES (AND (NOT (NUMBERP B))
(NUMBERP X)
(NUMBERP Z)
(LESSP Z W)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS Z (TIMES W X)) B)))
(NOT (LESSP X (QUOTIENT B W)))),
which further simplifies, unfolding the functions LESSP, QUOTIENT, and
EQUAL, to:
T.
Case 1.1.
(IMPLIES (AND (NUMBERP V)
(NUMBERP D)
(EQUAL (LESSP D W) (NOT (ZEROP W)))
(NUMBERP X)
(NUMBERP Z)
(LESSP Z W)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS Z (TIMES W X))
(PLUS D (TIMES W V)))))
(NOT (LESSP X V))),
which further simplifies, applying TIMES-COMMUTES1 and
QUOTIENT-MONOTONIC-LEMMA, and expanding the definitions of ZEROP and NOT,
to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
QUOTIENT-MONOTONIC
(PROVE-LEMMA NLST*-ALG-LEMMA2-HACK1
(REWRITE)
(IMPLIES
(AND (NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS (TIMES N W))
(PLUS R TS X)))
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL
(PLUS
(QUOTIENT (PLUS R X) W)
(QUOTIENT (DIFFERENCE (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
(TIMES W (QUOTIENT (PLUS R X) W)))
W))
(QUOTIENT (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
W)))
((DISABLE QUOTIENT-DIFFERENCE)
(USE
(QUOTIENT-DIFFERENCE (W W)
(A (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R))))
(B (QUOTIENT (PLUS R X) W))))))
WARNING: Note that NLST*-ALG-LEMMA2-HACK1 contains the free variable TS which
will be chosen by instantiating the hypothesis:
(NOT (LESSP (PLUS TS (TIMES N W))
(PLUS R TS X))).
WARNING: the previously added lemma, PLUS-COMMUTES1, could be applied
whenever the newly proposed NLST*-ALG-LEMMA2-HACK1 could!
This conjecture simplifies, unfolding the definitions of ZEROP, NOT, AND, and
IMPLIES, to the following two new conjectures:
Case 2. (IMPLIES
(AND (LESSP (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
(TIMES W (QUOTIENT (PLUS R X) W)))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS (TIMES N W))
(PLUS R TS X)))
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL
(PLUS
(QUOTIENT (PLUS R X) W)
(QUOTIENT
(DIFFERENCE (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
(TIMES W (QUOTIENT (PLUS R X) W)))
W))
(QUOTIENT (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
W))).
However this again simplifies, using linear arithmetic and applying
NOT-LESSP-TIMES-QUOTIENT-OTHER and NOT-LESSP-TIMES-QUOTIENT, to:
T.
Case 1. (IMPLIES
(AND
(EQUAL
(QUOTIENT
(DIFFERENCE (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
(TIMES W (QUOTIENT (PLUS R X) W)))
W)
(DIFFERENCE
(QUOTIENT (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
W)
(QUOTIENT (PLUS R X) W)))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS (TIMES N W))
(PLUS R TS X)))
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL
(PLUS
(QUOTIENT (PLUS R X) W)
(DIFFERENCE
(QUOTIENT (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
W)
(QUOTIENT (PLUS R X) W)))
(QUOTIENT (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
W))).
However this again simplifies, using linear arithmetic, to:
(IMPLIES
(AND
(LESSP (QUOTIENT (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
W)
(QUOTIENT (PLUS R X) W))
(EQUAL
(QUOTIENT
(DIFFERENCE (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
(TIMES W (QUOTIENT (PLUS R X) W)))
W)
(DIFFERENCE
(QUOTIENT (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
W)
(QUOTIENT (PLUS R X) W)))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS (TIMES N W))
(PLUS R TS X)))
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL
(PLUS
(QUOTIENT (PLUS R X) W)
(DIFFERENCE
(QUOTIENT (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
W)
(QUOTIENT (PLUS R X) W)))
(QUOTIENT (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
W))).
However this again simplifies, using linear arithmetic and rewriting with
NOT-LESSP-TIMES-QUOTIENT-OTHER and QUOTIENT-MONOTONIC, to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
NLST*-ALG-LEMMA2-HACK1
(PROVE-LEMMA NSIG*-UPPER-BOUND-LEMMA1
(REWRITE)
(IMPLIES (NOT (ZEROP R))
(NOT (LESSP (QUOTIENT (TIMES N W) R)
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R)))))
WARNING: Note that the proposed lemma NSIG*-UPPER-BOUND-LEMMA1 is to be
stored as zero type prescription rules, zero compound recognizer rules, one
linear rule, and zero replacement rules.
This conjecture can be simplified, using the abbreviations ZEROP, NOT, and
IMPLIES, to the formula:
(IMPLIES (AND (NOT (EQUAL R 0)) (NUMBERP R))
(NOT (LESSP (QUOTIENT (TIMES N W) R)
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R)))).
Appealing to the lemma DIFFERENCE-ELIM, we now replace TR by (PLUS TS X) to
eliminate (DIFFERENCE TR TS). We employ the type restriction lemma noted when
DIFFERENCE was introduced to constrain the new variable. This generates three
new conjectures:
Case 3. (IMPLIES (AND (LESSP TR TS)
(NOT (EQUAL R 0))
(NUMBERP R))
(NOT (LESSP (QUOTIENT (TIMES N W) R)
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R)))),
which simplifies, using linear arithmetic, rewriting with DIFFERENCE-IS-0,
and opening up the functions EQUAL and DIFFERENCE, to the following two new
formulas:
Case 3.2.
(IMPLIES (AND (LESSP TR TS)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL (TIMES N W) 0)))
(NOT (LESSP (QUOTIENT (TIMES N W) R)
(QUOTIENT (TIMES N W) R)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES (AND (LESSP TR TS)
(NOT (EQUAL R 0))
(NUMBERP R)
(EQUAL (TIMES N W) 0))
(NOT (LESSP (QUOTIENT (TIMES N W) R)
(QUOTIENT 0 R)))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (NUMBERP TR))
(NOT (EQUAL R 0))
(NUMBERP R))
(NOT (LESSP (QUOTIENT (TIMES N W) R)
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R)))),
which simplifies, using linear arithmetic, rewriting with DIFFERENCE-IS-0,
and unfolding the functions EQUAL and DIFFERENCE, to the following two new
goals:
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP TR))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL (TIMES N W) 0)))
(NOT (LESSP (QUOTIENT (TIMES N W) R)
(QUOTIENT (TIMES N W) R)))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP TR))
(NOT (EQUAL R 0))
(NUMBERP R)
(EQUAL (TIMES N W) 0))
(NOT (LESSP (QUOTIENT (TIMES N W) R)
(QUOTIENT 0 R)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NUMBERP X)
(NOT (LESSP (PLUS TS X) TS))
(NOT (EQUAL R 0))
(NUMBERP R))
(NOT (LESSP (QUOTIENT (TIMES N W) R)
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))),
which simplifies, using linear arithmetic and applying QUOTIENT-MONOTONIC,
to the new conjecture:
(IMPLIES (AND (NUMBERP X)
(NOT (LESSP (PLUS TS X) TS))
(NOT (EQUAL R 0))
(NUMBERP R)
(LESSP (TIMES N W) X))
(NOT (LESSP (QUOTIENT (TIMES N W) R)
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))),
which again simplifies, using linear arithmetic, applying DIFFERENCE-IS-0,
and unfolding LESSP, EQUAL, and QUOTIENT, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NSIG*-UPPER-BOUND-LEMMA1
(PROVE-LEMMA QUOTIENT-TIMES
(REWRITE)
(IMPLIES (NOT (ZEROP R))
(EQUAL (QUOTIENT (TIMES N R) R)
(FIX N)))
((DISABLE QUOTIENT-PLUS-TIMES)
(USE (QUOTIENT-PLUS-TIMES (W R)
(V 0)
(I N)))))
This formula can be simplified, using the abbreviations ZEROP, NOT, and
IMPLIES, to:
(IMPLIES (AND (IMPLIES (NOT (ZEROP R))
(EQUAL (QUOTIENT (PLUS 0 (TIMES R N)) R)
(PLUS N (QUOTIENT 0 R))))
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (QUOTIENT (TIMES N R) R)
(FIX N))),
which simplifies, applying the lemmas TIMES-COMMUTES1 and PLUS-COMMUTES1, and
opening up the definitions of ZEROP, NOT, EQUAL, PLUS, LESSP, QUOTIENT,
IMPLIES, TIMES, and FIX, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-TIMES
(PROVE-LEMMA MULTIPLY-BOTH-SIDES-OF-LESSP
(REWRITE)
(IMPLIES (NOT (ZEROP R))
(EQUAL (LESSP (TIMES A R) (TIMES B R))
(LESSP A B))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, and
IMPLIES, to:
(IMPLIES (AND (NOT (EQUAL R 0)) (NUMBERP R))
(EQUAL (LESSP (TIMES A R) (TIMES B R))
(LESSP A B))).
Name the above subgoal *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 (ZEROP A) (p A R B))
(IMPLIES (AND (NOT (ZEROP A))
(p (SUB1 A) R (SUB1 B)))
(p A R B))).
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. Note, however, the
inductive instance chosen for B. The above induction scheme leads to the
following two new goals:
Case 2. (IMPLIES (AND (ZEROP A)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (LESSP (TIMES A R) (TIMES B R))
(LESSP A B))).
This simplifies, opening up ZEROP, EQUAL, TIMES, and LESSP, to the following
six new conjectures:
Case 2.6.
(IMPLIES (AND (EQUAL A 0)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL B 0))
(EQUAL (PLUS R (TIMES (SUB1 B) R)) 0))
(EQUAL F (NUMBERP B))).
This again simplifies, using linear arithmetic, to:
T.
Case 2.5.
(IMPLIES (AND (EQUAL A 0)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL B 0))
(NOT (NUMBERP B)))
(EQUAL F (NUMBERP B))),
which again simplifies, clearly, to:
T.
Case 2.4.
(IMPLIES (AND (EQUAL A 0)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL (PLUS R (TIMES (SUB1 B) R))
0)))
(EQUAL T (NUMBERP B))).
This again simplifies, obviously, to:
T.
Case 2.3.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL B 0))
(EQUAL (PLUS R (TIMES (SUB1 B) R)) 0))
(EQUAL F (NUMBERP B))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL B 0))
(NOT (NUMBERP B)))
(EQUAL F (NUMBERP B))),
which again simplifies, clearly, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP A))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL B 0))
(NUMBERP B)
(NOT (EQUAL (PLUS R (TIMES (SUB1 B) R))
0)))
(EQUAL T (NUMBERP B))).
This again simplifies, clearly, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP A))
(EQUAL (LESSP (TIMES (SUB1 A) R)
(TIMES (SUB1 B) R))
(LESSP (SUB1 A) (SUB1 B)))
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (LESSP (TIMES A R) (TIMES B R))
(LESSP A B))).
This simplifies, expanding ZEROP, TIMES, and LESSP, to the following three
new goals:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (LESSP (TIMES (SUB1 A) R)
(TIMES (SUB1 B) R))
(LESSP (SUB1 A) (SUB1 B)))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL B 0))
(NUMBERP B))
(EQUAL (LESSP (PLUS R (TIMES (SUB1 A) R))
(PLUS R (TIMES (SUB1 B) R)))
(LESSP (SUB1 A) (SUB1 B)))).
However this further simplifies, rewriting with TIMES-COMMUTES1, to the
new formula:
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (LESSP (TIMES R (SUB1 A))
(TIMES R (SUB1 B)))
(LESSP (SUB1 A) (SUB1 B)))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL B 0))
(NUMBERP B))
(EQUAL (LESSP (PLUS R (TIMES R (SUB1 A)))
(PLUS R (TIMES R (SUB1 B))))
(LESSP (SUB1 A) (SUB1 B)))).
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. This produces:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (ADD1 X) 0))
(EQUAL (LESSP (TIMES R X) (TIMES R (SUB1 B)))
(LESSP X (SUB1 B)))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL B 0))
(NUMBERP B))
(EQUAL (LESSP (PLUS R (TIMES R X))
(PLUS R (TIMES R (SUB1 B))))
(LESSP X (SUB1 B)))),
which further simplifies, clearly, to:
(IMPLIES (AND (NUMBERP X)
(EQUAL (LESSP (TIMES R X) (TIMES R (SUB1 B)))
(LESSP X (SUB1 B)))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL B 0))
(NUMBERP B))
(EQUAL (LESSP (PLUS R (TIMES R X))
(PLUS R (TIMES R (SUB1 B))))
(LESSP X (SUB1 B)))).
Applying the lemma SUB1-ELIM, replace B by (ADD1 Z) to eliminate (SUB1 B).
We employ the type restriction lemma noted when SUB1 was introduced to
restrict the new variable. We would thus like to prove the new conjecture:
(IMPLIES (AND (NUMBERP Z)
(NUMBERP X)
(EQUAL (LESSP (TIMES R X) (TIMES R Z))
(LESSP X Z))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL (ADD1 Z) 0)))
(EQUAL (LESSP (PLUS R (TIMES R X))
(PLUS R (TIMES R Z)))
(LESSP X Z))),
which further simplifies, obviously, to:
(IMPLIES (AND (NUMBERP Z)
(NUMBERP X)
(EQUAL (LESSP (TIMES R X) (TIMES R Z))
(LESSP X Z))
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (LESSP (PLUS R (TIMES R X))
(PLUS R (TIMES R Z)))
(LESSP X Z))).
We now use the above equality hypothesis by substituting:
(LESSP (TIMES R X) (TIMES R Z))
for (LESSP X Z) and throwing away the equality. The result is:
(IMPLIES (AND (NUMBERP Z)
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (LESSP (PLUS R (TIMES R X))
(PLUS R (TIMES R Z)))
(LESSP (TIMES R X) (TIMES R Z)))).
We will try to prove the above formula by generalizing it, replacing
(TIMES R Z) by Y and (TIMES R X) by U. We restrict the new variables by
recalling the type restriction lemma noted when TIMES was introduced.
This produces:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP U)
(NUMBERP Z)
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (LESSP (PLUS R U) (PLUS R Y))
(LESSP U Y))),
which has two irrelevant terms in it. By eliminating these terms we get
the new formula:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP U)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (LESSP (PLUS R U) (PLUS R Y))
(LESSP U Y))),
which we will finally name *1.1.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (LESSP (TIMES (SUB1 A) R)
(TIMES (SUB1 B) R))
(LESSP (SUB1 A) (SUB1 B)))
(NOT (EQUAL R 0))
(NUMBERP R)
(EQUAL B 0))
(EQUAL (LESSP (PLUS R (TIMES (SUB1 A) R)) 0)
F)).
But this again simplifies, unfolding the functions SUB1, EQUAL, TIMES, and
LESSP, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL A 0))
(NUMBERP A)
(EQUAL (LESSP (TIMES (SUB1 A) R)
(TIMES (SUB1 B) R))
(LESSP (SUB1 A) (SUB1 B)))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NUMBERP B)))
(EQUAL (LESSP (PLUS R (TIMES (SUB1 A) R)) 0)
F)),
which again simplifies, opening up EQUAL and LESSP, to:
T.
So next consider:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP U)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (LESSP (PLUS R U) (PLUS R Y))
(LESSP U Y))),
which we named *1.1 above. Let us appeal to the induction principle. 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 R) (p R U Y))
(IMPLIES (AND (NOT (ZEROP R)) (p (SUB1 R) U Y))
(p R U Y))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definition
of ZEROP can be used to prove that the measure (COUNT R) decreases according
to the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme generates the following three new conjectures:
Case 3. (IMPLIES (AND (ZEROP R)
(NUMBERP Y)
(NUMBERP U)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (LESSP (PLUS R U) (PLUS R Y))
(LESSP U Y))).
This simplifies, unfolding ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP R))
(EQUAL (SUB1 R) 0)
(NUMBERP Y)
(NUMBERP U)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (LESSP (PLUS R U) (PLUS R Y))
(LESSP U Y))).
This simplifies, applying SUB1-ADD1, and unfolding ZEROP, PLUS, and LESSP,
to:
(IMPLIES (AND (EQUAL (SUB1 R) 0)
(NUMBERP Y)
(NUMBERP U)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (LESSP (PLUS (SUB1 R) U)
(PLUS (SUB1 R) Y))
(LESSP U Y))).
But this again simplifies, unfolding the functions EQUAL and PLUS, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP R))
(EQUAL (LESSP (PLUS (SUB1 R) U)
(PLUS (SUB1 R) Y))
(LESSP U Y))
(NUMBERP Y)
(NUMBERP U)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (LESSP (PLUS R U) (PLUS R Y))
(LESSP U Y))),
which simplifies, applying SUB1-ADD1, and unfolding the functions ZEROP,
PLUS, and LESSP, to:
T.
That finishes the proof of *1.1, which, in turn, also finishes the proof
of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
MULTIPLY-BOTH-SIDES-OF-LESSP
(PROVE-LEMMA LESSP-QUOTIENT-TO-LESSP-TIMES-LEMMA1 NIL
(IMPLIES (AND (NOT (ZEROP R))
(NOT (LESSP (QUOTIENT X R) N)))
(NOT (LESSP X (TIMES N R))))
((DISABLE MULTIPLY-BOTH-SIDES-OF-LESSP)
(USE (MULTIPLY-BOTH-SIDES-OF-LESSP (A (QUOTIENT X R))
(B N)))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to:
(IMPLIES (AND (IMPLIES (NOT (ZEROP R))
(EQUAL (LESSP (TIMES (QUOTIENT X R) R)
(TIMES N R))
(LESSP (QUOTIENT X R) N)))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (QUOTIENT X R) N)))
(NOT (LESSP X (TIMES N R)))).
This simplifies, applying TIMES-COMMUTES1, and unfolding the functions ZEROP,
NOT, and IMPLIES, to the goal:
(IMPLIES (AND (NOT (LESSP (TIMES R (QUOTIENT X R))
(TIMES N R)))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (QUOTIENT X R) N)))
(NOT (LESSP X (TIMES N R)))).
However this again simplifies, using linear arithmetic and rewriting with the
lemma NOT-LESSP-TIMES-QUOTIENT, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-QUOTIENT-TO-LESSP-TIMES-LEMMA1
(PROVE-LEMMA LESSP-QUOTIENT-TO-LESSP-TIMES-LEMMA2 NIL
(IMPLIES (AND (NOT (ZEROP R))
(NOT (LESSP X (TIMES N R))))
(NOT (LESSP (QUOTIENT X R) N)))
((DISABLE QUOTIENT-MONOTONIC)
(USE (QUOTIENT-MONOTONIC (A X)
(B (TIMES N R))
(W R)))))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (IMPLIES (AND (NOT (ZEROP R))
(NOT (LESSP X (TIMES N R))))
(EQUAL (LESSP (QUOTIENT X R)
(QUOTIENT (TIMES N R) R))
F))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP X (TIMES N R))))
(NOT (LESSP (QUOTIENT X R) N))),
which simplifies, applying QUOTIENT-TIMES, and opening up the functions ZEROP,
NOT, AND, IMPLIES, TIMES, EQUAL, and LESSP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-QUOTIENT-TO-LESSP-TIMES-LEMMA2
(PROVE-LEMMA LESSP-QUOTIENT-TO-LESSP-TIMES
(REWRITE)
(IMPLIES (NOT (ZEROP R))
(EQUAL (LESSP (QUOTIENT X R) N)
(LESSP X (TIMES N R))))
((USE (LESSP-QUOTIENT-TO-LESSP-TIMES-LEMMA1)
(LESSP-QUOTIENT-TO-LESSP-TIMES-LEMMA2))))
WARNING: the newly proposed lemma, LESSP-QUOTIENT-TO-LESSP-TIMES, could be
applied whenever the previously added lemma QUOTIENT-MONOTONIC could.
This formula can be simplified, using the abbreviations ZEROP, NOT, IMPLIES,
and AND, to the new formula:
(IMPLIES (AND (IMPLIES (AND (NOT (ZEROP R))
(NOT (LESSP (QUOTIENT X R) N)))
(NOT (LESSP X (TIMES N R))))
(IMPLIES (AND (NOT (ZEROP R))
(NOT (LESSP X (TIMES N R))))
(NOT (LESSP (QUOTIENT X R) N)))
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (LESSP (QUOTIENT X R) N)
(LESSP X (TIMES N R)))),
which simplifies, unfolding the definitions of ZEROP, NOT, AND, and IMPLIES,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-QUOTIENT-TO-LESSP-TIMES
(PROVE-LEMMA QUOTIENT-PLUS-TIMES1
(REWRITE)
(IMPLIES (NOT (ZEROP R))
(EQUAL (QUOTIENT (PLUS (TIMES N R) Z) R)
(PLUS N (QUOTIENT Z R))))
((DISABLE QUOTIENT-PLUS-TIMES)
(USE (QUOTIENT-PLUS-TIMES (V Z)
(I N)
(W R)))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, and
IMPLIES, to the formula:
(IMPLIES (AND (IMPLIES (NOT (ZEROP R))
(EQUAL (QUOTIENT (PLUS Z (TIMES R N)) R)
(PLUS N (QUOTIENT Z R))))
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (QUOTIENT (PLUS (TIMES N R) Z) R)
(PLUS N (QUOTIENT Z R)))).
This simplifies, rewriting with the lemmas TIMES-COMMUTES1 and PLUS-COMMUTES1,
and unfolding the definitions of ZEROP, NOT, and IMPLIES, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-PLUS-TIMES1
(PROVE-LEMMA EQUAL-TIMES-0
(REWRITE)
(EQUAL (EQUAL (TIMES I J) 0)
(OR (ZEROP I) (ZEROP J))))
This simplifies, opening up the functions ZEROP and OR, to five new
conjectures:
Case 5. (IMPLIES (NOT (EQUAL (TIMES I J) 0))
(NUMBERP J)),
which again simplifies, applying TIMES-NON-NUMBERP, and unfolding the
function EQUAL, to:
T.
Case 4. (IMPLIES (NOT (EQUAL (TIMES I J) 0))
(NOT (EQUAL J 0))).
However this again simplifies, applying TIMES-COMMUTES1, and unfolding the
functions EQUAL and TIMES, to:
T.
Case 3. (IMPLIES (NOT (EQUAL (TIMES I J) 0))
(NUMBERP I)).
This again simplifies, opening up the definitions of TIMES and EQUAL, to:
T.
Case 2. (IMPLIES (NOT (EQUAL (TIMES I J) 0))
(NOT (EQUAL I 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (EQUAL (TIMES I J) 0)
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL J 0)))
(NOT (NUMBERP J))),
which we will name *1.
Perhaps we can prove it by induction. There is only one plausible
induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP I) (p J I))
(IMPLIES (AND (NOT (ZEROP I)) (p J (SUB1 I)))
(p J I))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to establish that the measure (COUNT I) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme produces three new conjectures:
Case 3. (IMPLIES (AND (ZEROP I)
(EQUAL (TIMES I J) 0)
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL J 0)))
(NOT (NUMBERP J))),
which simplifies, unfolding the function ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP I))
(NOT (EQUAL (TIMES (SUB1 I) J) 0))
(EQUAL (TIMES I J) 0)
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL J 0)))
(NOT (NUMBERP J))),
which simplifies, opening up ZEROP and TIMES, to:
(IMPLIES (AND (NOT (EQUAL (TIMES (SUB1 I) J) 0))
(EQUAL (PLUS J (TIMES (SUB1 I) J)) 0)
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL J 0)))
(NOT (NUMBERP J))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP I))
(EQUAL (SUB1 I) 0)
(EQUAL (TIMES I J) 0)
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL J 0)))
(NOT (NUMBERP J))),
which simplifies, expanding the definitions of ZEROP and TIMES, to the
conjecture:
(IMPLIES (AND (EQUAL (SUB1 I) 0)
(EQUAL (PLUS J (TIMES (SUB1 I) J)) 0)
(NOT (EQUAL I 0))
(NUMBERP I)
(NOT (EQUAL J 0)))
(NOT (NUMBERP J))).
This again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-TIMES-0
(PROVE-LEMMA NSIG*-UPPER-BOUND-HACK1
(REWRITE)
(IMPLIES (AND (NOT (ZEROP R))
(NOT (LESSP R (TIMES 18 DELTA)))
(LESSP N 18))
(EQUAL (LESSP (TIMES N DELTA) R) T)))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP R (TIMES 18 DELTA)))
(LESSP N 18))
(EQUAL (LESSP (TIMES N DELTA) R) T)),
which simplifies, applying TIMES-COMMUTES1, to:
(IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP R (TIMES 18 DELTA)))
(LESSP N 18))
(LESSP (TIMES DELTA N) R)),
which we will name *1.
We will appeal to induction. The recursive terms in the conjecture
suggest four inductions. They merge into three likely candidate inductions,
two of which are unflawed. Since both of these are equally likely, we will
choose arbitrarily. We will induct according to the following scheme:
(AND (IMPLIES (OR (EQUAL (TIMES 18 DELTA) 0)
(NOT (NUMBERP (TIMES 18 DELTA))))
(p DELTA N R))
(IMPLIES (AND (NOT (OR (EQUAL (TIMES 18 DELTA) 0)
(NOT (NUMBERP (TIMES 18 DELTA)))))
(OR (EQUAL R 0) (NOT (NUMBERP R))))
(p DELTA N R))
(IMPLIES (AND (NOT (OR (EQUAL (TIMES 18 DELTA) 0)
(NOT (NUMBERP (TIMES 18 DELTA)))))
(NOT (OR (EQUAL R 0) (NOT (NUMBERP R))))
(p DELTA N (SUB1 R)))
(p DELTA N R))).
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 R) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. The above induction scheme leads to five new formulas:
Case 5. (IMPLIES (AND (OR (EQUAL (TIMES 18 DELTA) 0)
(NOT (NUMBERP (TIMES 18 DELTA))))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP R (TIMES 18 DELTA)))
(LESSP N 18))
(LESSP (TIMES DELTA N) R)),
which simplifies, applying the lemmas EQUAL-TIMES-0 and TIMES-NON-NUMBERP,
and opening up the definitions of EQUAL, NUMBERP, NOT, OR, TIMES, and LESSP,
to:
T.
Case 4. (IMPLIES (AND (NOT (OR (EQUAL (TIMES 18 DELTA) 0)
(NOT (NUMBERP (TIMES 18 DELTA)))))
(OR (EQUAL R 0) (NOT (NUMBERP R)))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP R (TIMES 18 DELTA)))
(LESSP N 18))
(LESSP (TIMES DELTA N) R)),
which simplifies, applying EQUAL-TIMES-0, and unfolding EQUAL, NUMBERP, NOT,
and OR, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (EQUAL (TIMES 18 DELTA) 0)
(NOT (NUMBERP (TIMES 18 DELTA)))))
(NOT (OR (EQUAL R 0) (NOT (NUMBERP R))))
(EQUAL (SUB1 R) 0)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP R (TIMES 18 DELTA)))
(LESSP N 18))
(LESSP (TIMES DELTA N) R)).
This simplifies, applying EQUAL-TIMES-0, and opening up the functions EQUAL,
NUMBERP, NOT, OR, and LESSP, to:
(IMPLIES (AND (NOT (EQUAL DELTA 0))
(NUMBERP DELTA)
(EQUAL (SUB1 R) 0)
(NOT (EQUAL R 0))
(NUMBERP R)
(EQUAL (SUB1 (TIMES 18 DELTA)) 0)
(LESSP N 18)
(NOT (EQUAL N 0)))
(NOT (NUMBERP N))).
But this again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL (TIMES 18 DELTA) 0)
(NOT (NUMBERP (TIMES 18 DELTA)))))
(NOT (OR (EQUAL R 0) (NOT (NUMBERP R))))
(LESSP (SUB1 R) (TIMES 18 DELTA))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP R (TIMES 18 DELTA)))
(LESSP N 18))
(LESSP (TIMES DELTA N) R)),
which simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (OR (EQUAL (TIMES 18 DELTA) 0)
(NOT (NUMBERP (TIMES 18 DELTA)))))
(NOT (OR (EQUAL (TIMES 18 DELTA) 0)
(NOT (NUMBERP (TIMES 18 DELTA)))))
(LESSP (SUB1 (TIMES 18 DELTA))
(TIMES 18 DELTA))
(NOT (EQUAL (TIMES 18 DELTA) 0))
(NUMBERP (TIMES 18 DELTA))
(NOT (LESSP (TIMES 18 DELTA)
(TIMES 18 DELTA)))
(LESSP N 18))
(LESSP (TIMES DELTA N)
(TIMES 18 DELTA))).
But this again simplifies, rewriting with the lemmas EQUAL-TIMES-0 and
MULTIPLY-BOTH-SIDES-OF-LESSP, and expanding the definitions of EQUAL,
NUMBERP, NOT, OR, and LESSP, to the conjecture:
(IMPLIES (AND (NOT (EQUAL DELTA 0))
(NUMBERP DELTA)
(LESSP (SUB1 (TIMES 18 DELTA))
(TIMES 18 DELTA))
(LESSP N 18))
(LESSP (TIMES DELTA N)
(TIMES 18 DELTA))).
This again simplifies, using linear arithmetic and applying TIMES-MONOTONIC
and TIMES-COMMUTES1, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL (TIMES 18 DELTA) 0)
(NOT (NUMBERP (TIMES 18 DELTA)))))
(NOT (OR (EQUAL R 0) (NOT (NUMBERP R))))
(LESSP (TIMES DELTA N) (SUB1 R))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP R (TIMES 18 DELTA)))
(LESSP N 18))
(LESSP (TIMES DELTA N) R)).
This simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
NSIG*-UPPER-BOUND-HACK1
(PROVE-LEMMA NSIG*-UPPER-BOUND-HACK2
(REWRITE)
(IMPLIES (AND (NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (ZEROP N))
(LESSP N 18)
(LESSP W R))
(EQUAL (PLUS W (TIMES W (SUB1 N)))
(PLUS (TIMES (SUB1 N) (DIFFERENCE R W))
(DIFFERENCE W
(TIMES (SUB1 N) (DIFFERENCE R W)))
(TIMES W (SUB1 N))))))
WARNING: Note that NSIG*-UPPER-BOUND-HACK2 contains the free variable R which
will be chosen by instantiating the hypothesis:
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W)))).
WARNING: the previously added lemma, PLUS-COMMUTES1, could be applied
whenever the newly proposed NSIG*-UPPER-BOUND-HACK2 could!
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to:
(IMPLIES (AND (NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL N 0))
(NUMBERP N)
(LESSP N 18)
(LESSP W R))
(EQUAL (PLUS W (TIMES W (SUB1 N)))
(PLUS (TIMES (SUB1 N) (DIFFERENCE R W))
(DIFFERENCE W
(TIMES (SUB1 N) (DIFFERENCE R W)))
(TIMES W (SUB1 N))))).
This simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP W
(TIMES (SUB1 N) (DIFFERENCE R W)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL N 0))
(NUMBERP N)
(LESSP N 18)
(LESSP W R))
(EQUAL (PLUS W (TIMES W (SUB1 N)))
(PLUS (TIMES (SUB1 N) (DIFFERENCE R W))
(DIFFERENCE W
(TIMES (SUB1 N) (DIFFERENCE R W)))
(TIMES W (SUB1 N))))),
which again simplifies, using linear arithmetic, applying the lemmas
DIFFERENCE-IS-0 and PLUS-COMMUTES1, and unfolding the functions SUB1, NUMBERP,
EQUAL, LESSP, and PLUS, to:
(IMPLIES (AND (LESSP W
(TIMES (SUB1 N) (DIFFERENCE R W)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (SUB1 N) 17)
(LESSP W R))
(EQUAL (PLUS W (TIMES W (SUB1 N)))
(PLUS (TIMES W (SUB1 N))
(TIMES (SUB1 N) (DIFFERENCE R W))))).
Appealing to the lemma DIFFERENCE-ELIM, we now replace R by (PLUS W X) to
eliminate (DIFFERENCE R W). We employ the type restriction lemma noted when
DIFFERENCE was introduced to constrain the new variable. The result is two
new conjectures:
Case 2. (IMPLIES (AND (LESSP R W)
(LESSP W
(TIMES (SUB1 N) (DIFFERENCE R W)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (SUB1 N) 17)
(LESSP W R))
(EQUAL (PLUS W (TIMES W (SUB1 N)))
(PLUS (TIMES W (SUB1 N))
(TIMES (SUB1 N) (DIFFERENCE R W))))),
which further simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NUMBERP X)
(NOT (LESSP (PLUS W X) W))
(LESSP W (TIMES (SUB1 N) X))
(NOT (LESSP (PLUS (PLUS W X)
(PLUS W X)
(TIMES 17 (PLUS W X)))
(PLUS W (TIMES 17 W))))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 (PLUS W X))))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL (PLUS W X) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (SUB1 N) 17)
(LESSP W (PLUS W X)))
(EQUAL (PLUS W (TIMES W (SUB1 N)))
(PLUS (TIMES W (SUB1 N))
(TIMES (SUB1 N) X)))),
which further simplifies, rewriting with the lemmas TIMES-COMMUTES1,
TIMES-DISTRIBUTES1, PLUS-ASSOCIATES, and PLUS-COMMUTES2, to:
(IMPLIES (AND (NUMBERP X)
(NOT (LESSP (PLUS W X) W))
(LESSP W (TIMES X (SUB1 N)))
(NOT (LESSP (PLUS W W X X
(TIMES 17 W)
(TIMES 17 X))
(PLUS W (TIMES 17 W))))
(NOT (LESSP (PLUS W (TIMES 17 W))
(PLUS (TIMES 17 W) (TIMES 17 X))))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL (PLUS W X) 0))
(NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (SUB1 N) 17)
(LESSP W (PLUS W X)))
(EQUAL (PLUS W (TIMES W (SUB1 N)))
(PLUS (TIMES W (SUB1 N))
(TIMES X (SUB1 N))))).
This again simplifies, using linear arithmetic and rewriting with
TIMES-MONOTONIC and TIMES-COMMUTES1, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
NSIG*-UPPER-BOUND-HACK2
(PROVE-LEMMA QUOTIENT-PLUS-TIMES3
(REWRITE)
(IMPLIES (NOT (ZEROP (PLUS X Z (TIMES X N))))
(EQUAL (QUOTIENT (PLUS Z
(TIMES X N)
(TIMES Z N)
(TIMES X N N))
(PLUS X Z (TIMES X N)))
(PLUS N
(QUOTIENT Z (PLUS X Z (TIMES N X))))))
((DISABLE QUOTIENT-PLUS-TIMES)
(USE (QUOTIENT-PLUS-TIMES (V Z)
(W (PLUS X Z (TIMES X N)))
(I N)))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, and
IMPLIES, to the formula:
(IMPLIES
(AND (IMPLIES (NOT (ZEROP (PLUS X Z (TIMES X N))))
(EQUAL (QUOTIENT (PLUS Z
(TIMES (PLUS X Z (TIMES X N)) N))
(PLUS X Z (TIMES X N)))
(PLUS N
(QUOTIENT Z (PLUS X Z (TIMES X N))))))
(NOT (EQUAL (PLUS X Z (TIMES X N)) 0))
(NUMBERP (PLUS X Z (TIMES X N))))
(EQUAL (QUOTIENT (PLUS Z
(TIMES X N)
(TIMES Z N)
(TIMES X N N))
(PLUS X Z (TIMES X N)))
(PLUS N
(QUOTIENT Z
(PLUS X Z (TIMES N X)))))).
This simplifies, using linear arithmetic, applying TIMES-COMMUTES1,
TIMES-ASSOCIATES, TIMES-DISTRIBUTES2, DIFFERENCE-IS-0, TIMES-COMMUTES2, and
PLUS-COMMUTES1, and unfolding the functions ZEROP, NOT, QUOTIENT, LESSP, EQUAL,
ADD1, IMPLIES, SUB1, NUMBERP, and PLUS, to four new conjectures:
Case 4. (IMPLIES (AND (NOT (LESSP Z (PLUS X Z (TIMES N X))))
(EQUAL (QUOTIENT (PLUS Z
(TIMES N X)
(TIMES N Z)
(TIMES N N X))
(PLUS X Z (TIMES N X)))
(PLUS N 1))
(NOT (EQUAL (PLUS X Z (TIMES N X)) 0))
(NOT (NUMBERP N)))
(EQUAL (PLUS N 1) 1)),
which again simplifies, applying PLUS-COMMUTES1, TIMES-NON-NUMBERP, and
TIMES-COMMUTES1, and opening up the definitions of TIMES, EQUAL, PLUS, LESSP,
QUOTIENT, SUB1, NUMBERP, and ADD1, to:
T.
Case 3. (IMPLIES (AND (NOT (LESSP Z (PLUS X Z (TIMES N X))))
(EQUAL (QUOTIENT (PLUS Z
(TIMES N X)
(TIMES N Z)
(TIMES N N X))
(PLUS X Z (TIMES N X)))
(PLUS N 1))
(NOT (EQUAL (PLUS X Z (TIMES N X)) 0))
(NUMBERP N))
(EQUAL (PLUS N 1) (ADD1 N))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (LESSP Z (PLUS X Z (TIMES N X)))
(EQUAL (QUOTIENT (PLUS Z
(TIMES N X)
(TIMES N Z)
(TIMES N N X))
(PLUS X Z (TIMES N X)))
(PLUS N 0))
(NOT (EQUAL (PLUS X Z (TIMES N X)) 0))
(NOT (NUMBERP N)))
(EQUAL (PLUS N 0) 0)),
which again simplifies, rewriting with the lemmas PLUS-COMMUTES1,
TIMES-NON-NUMBERP, and TIMES-COMMUTES1, and expanding the definitions of
TIMES, EQUAL, PLUS, LESSP, and QUOTIENT, to:
T.
Case 1. (IMPLIES (AND (LESSP Z (PLUS X Z (TIMES N X)))
(EQUAL (QUOTIENT (PLUS Z
(TIMES N X)
(TIMES N Z)
(TIMES N N X))
(PLUS X Z (TIMES N X)))
(PLUS N 0))
(NOT (EQUAL (PLUS X Z (TIMES N X)) 0))
(NUMBERP N))
(EQUAL (PLUS N 0) N)),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
QUOTIENT-PLUS-TIMES3
(PROVE-LEMMA NSIG*-UPPER-BOUND-HACK3
(REWRITE)
(IMPLIES (LESSP (PLUS Z (TIMES X (SUB1 N)))
(PLUS X Z (TIMES X (SUB1 N))))
(EQUAL (LESSP Z
(PLUS X Z (TIMES X (SUB1 N))))
T)))
This conjecture simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NSIG*-UPPER-BOUND-HACK3
(PROVE-LEMMA INTRO-DELTA NIL
(IMPLIES (AND (NUMBERP W) (NOT (LESSP W R)))
(EQUAL W (PLUS R (DIFFERENCE W R)))))
This conjecture simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
INTRO-DELTA
(PROVE-LEMMA NSIG*-UPPER-BOUND-LEMMA2-1 NIL
(IMPLIES (AND (NUMBERP N)
(NOT (ZEROP W))
(NOT (ZEROP R))
(RATE-PROXIMITY W R)
(LESSP N 18)
(NOT (LESSP W R)))
(EQUAL (QUOTIENT (TIMES N W) R) N))
((USE (INTRO-DELTA))))
This conjecture can be simplified, using the abbreviations RATE-PROXIMITY,
ZEROP, NOT, AND, and IMPLIES, to:
(IMPLIES (AND (IMPLIES (AND (NUMBERP W) (NOT (LESSP W R)))
(EQUAL W (PLUS R (DIFFERENCE W R))))
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18)
(NOT (LESSP W R)))
(EQUAL (QUOTIENT (TIMES N W) R) N)).
This simplifies, unfolding the functions NOT, AND, IMPLIES, SUB1, NUMBERP,
EQUAL, and TIMES, to:
(IMPLIES (AND (EQUAL W (PLUS R (DIFFERENCE W R)))
(NUMBERP N)
(NOT (EQUAL W 0))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(LESSP N 18)
(NOT (LESSP W R)))
(EQUAL (QUOTIENT (TIMES N W) R) N)).
Applying the lemma DIFFERENCE-ELIM, replace W by (PLUS R X) to eliminate
(DIFFERENCE W R). We employ 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 W))
(EQUAL W (PLUS R (DIFFERENCE W R)))
(NUMBERP N)
(NOT (EQUAL W 0))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(LESSP N 18)
(NOT (LESSP W R)))
(EQUAL (QUOTIENT (TIMES N W) R) N)).
This further simplifies, trivially, to:
T.
Case 1. (IMPLIES (AND (NUMBERP X)
(EQUAL (PLUS R X) (PLUS R X))
(NUMBERP N)
(NOT (EQUAL (PLUS R X) 0))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS (PLUS R X)
(TIMES 17 (PLUS R X)))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS (PLUS R X)
(TIMES 17 (PLUS R X)))))
(LESSP N 18)
(NOT (LESSP (PLUS R X) R)))
(EQUAL (QUOTIENT (TIMES N (PLUS R X)) R)
N)).
This further simplifies, appealing to the lemmas TIMES-DISTRIBUTES1,
PLUS-ASSOCIATES, and QUOTIENT-PLUS-TIMES1, to:
(IMPLIES (AND (NUMBERP X)
(NUMBERP N)
(NOT (EQUAL (PLUS R X) 0))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS R X (TIMES 17 R) (TIMES 17 X))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS R X (TIMES 17 R) (TIMES 17 X))))
(LESSP N 18)
(NOT (LESSP (PLUS R X) R)))
(EQUAL (PLUS N (QUOTIENT (TIMES N X) R))
N)).
This again simplifies, using linear arithmetic, rewriting with the lemmas
NSIG*-UPPER-BOUND-HACK1 and PLUS-COMMUTES1, and unfolding the definitions of
SUB1, NUMBERP, EQUAL, TIMES, QUOTIENT, and PLUS, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
NSIG*-UPPER-BOUND-LEMMA2-1
(PROVE-LEMMA NSIG*-UPPER-BOUND-LEMMA2-2 NIL
(IMPLIES (AND (NUMBERP N)
(NOT (ZEROP W))
(NOT (ZEROP R))
(RATE-PROXIMITY W R)
(LESSP N 18)
(LESSP W R))
(EQUAL (QUOTIENT (TIMES N W) R)
(SUB1 N)))
((EXPAND (TIMES N W))))
This conjecture can be simplified, using the abbreviations RATE-PROXIMITY,
ZEROP, NOT, AND, and IMPLIES, to the goal:
(IMPLIES (AND (NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18)
(LESSP W R))
(EQUAL (QUOTIENT (TIMES N W) R)
(SUB1 N))).
This simplifies, using linear arithmetic, applying TIMES-COMMUTES1,
PLUS-COMMUTES1, PLUS-COMMUTES2, and NSIG*-UPPER-BOUND-HACK2, and expanding the
definitions of SUB1, NUMBERP, EQUAL, TIMES, LESSP, and QUOTIENT, to two new
goals:
Case 2. (IMPLIES
(AND (NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(LESSP (SUB1 N) 17)
(LESSP W R)
(NOT (EQUAL N 0)))
(EQUAL (QUOTIENT (PLUS (TIMES W (SUB1 N))
(TIMES (SUB1 N) (DIFFERENCE R W))
(DIFFERENCE W
(TIMES (SUB1 N) (DIFFERENCE R W))))
R)
(SUB1 N))).
Applying the lemma DIFFERENCE-ELIM, replace R by (PLUS W X) to eliminate
(DIFFERENCE R W). We employ the type restriction lemma noted when
DIFFERENCE was introduced to restrict the new variable. We thus obtain the
following two new formulas:
Case 2.2.
(IMPLIES
(AND (LESSP R W)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(LESSP (SUB1 N) 17)
(LESSP W R)
(NOT (EQUAL N 0)))
(EQUAL
(QUOTIENT (PLUS (TIMES W (SUB1 N))
(TIMES (SUB1 N) (DIFFERENCE R W))
(DIFFERENCE W
(TIMES (SUB1 N) (DIFFERENCE R W))))
R)
(SUB1 N))).
This further simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NUMBERP X)
(NOT (LESSP (PLUS W X) W))
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL (PLUS W X) 0))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 (PLUS W X))))
(NOT (LESSP (PLUS (PLUS W X)
(PLUS W X)
(TIMES 17 (PLUS W X)))
(PLUS W (TIMES 17 W))))
(LESSP (SUB1 N) 17)
(LESSP W (PLUS W X))
(NOT (EQUAL N 0)))
(EQUAL (QUOTIENT (PLUS (TIMES W (SUB1 N))
(TIMES (SUB1 N) X)
(DIFFERENCE W (TIMES (SUB1 N) X)))
(PLUS W X))
(SUB1 N))),
which further simplifies, rewriting with TIMES-DISTRIBUTES1,
PLUS-ASSOCIATES, PLUS-COMMUTES2, and TIMES-COMMUTES1, to:
(IMPLIES (AND (NUMBERP X)
(NOT (LESSP (PLUS W X) W))
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL (PLUS W X) 0))
(NOT (LESSP (PLUS W (TIMES 17 W))
(PLUS (TIMES 17 W) (TIMES 17 X))))
(NOT (LESSP (PLUS W W X X
(TIMES 17 W)
(TIMES 17 X))
(PLUS W (TIMES 17 W))))
(LESSP (SUB1 N) 17)
(LESSP W (PLUS W X))
(NOT (EQUAL N 0)))
(EQUAL (QUOTIENT (PLUS (TIMES W (SUB1 N))
(TIMES X (SUB1 N))
(DIFFERENCE W (TIMES X (SUB1 N))))
(PLUS W X))
(SUB1 N))).
Applying the lemma DIFFERENCE-ELIM, replace W by:
(PLUS (TIMES X (SUB1 N)) Z)
to eliminate (DIFFERENCE W (TIMES X (SUB1 N))). 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.1.2.
(IMPLIES (AND (LESSP W (TIMES X (SUB1 N)))
(NUMBERP X)
(NOT (LESSP (PLUS W X) W))
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL (PLUS W X) 0))
(NOT (LESSP (PLUS W (TIMES 17 W))
(PLUS (TIMES 17 W) (TIMES 17 X))))
(NOT (LESSP (PLUS W W X X
(TIMES 17 W)
(TIMES 17 X))
(PLUS W (TIMES 17 W))))
(LESSP (SUB1 N) 17)
(LESSP W (PLUS W X))
(NOT (EQUAL N 0)))
(EQUAL (QUOTIENT (PLUS (TIMES W (SUB1 N))
(TIMES X (SUB1 N))
(DIFFERENCE W (TIMES X (SUB1 N))))
(PLUS W X))
(SUB1 N))).
However this further simplifies, using linear arithmetic and rewriting
with TIMES-MONOTONIC and TIMES-COMMUTES1, to:
T.
Case 2.1.1.
(IMPLIES
(AND (NUMBERP Z)
(NOT (LESSP (PLUS (TIMES X (SUB1 N)) Z)
(TIMES X (SUB1 N))))
(NUMBERP X)
(NOT (LESSP (PLUS (PLUS (TIMES X (SUB1 N)) Z) X)
(PLUS (TIMES X (SUB1 N)) Z)))
(NUMBERP N)
(NOT (EQUAL (PLUS (TIMES X (SUB1 N)) Z) 0))
(NOT (EQUAL (PLUS (PLUS (TIMES X (SUB1 N)) Z) X)
0))
(NOT (LESSP (PLUS (PLUS (TIMES X (SUB1 N)) Z)
(TIMES 17
(PLUS (TIMES X (SUB1 N)) Z)))
(PLUS (TIMES 17 (PLUS (TIMES X (SUB1 N)) Z))
(TIMES 17 X))))
(NOT (LESSP (PLUS (PLUS (TIMES X (SUB1 N)) Z)
(PLUS (TIMES X (SUB1 N)) Z)
X X
(TIMES 17 (PLUS (TIMES X (SUB1 N)) Z))
(TIMES 17 X))
(PLUS (PLUS (TIMES X (SUB1 N)) Z)
(TIMES 17
(PLUS (TIMES X (SUB1 N)) Z)))))
(LESSP (SUB1 N) 17)
(LESSP (PLUS (TIMES X (SUB1 N)) Z)
(PLUS (PLUS (TIMES X (SUB1 N)) Z) X))
(NOT (EQUAL N 0)))
(EQUAL (QUOTIENT (PLUS (TIMES (PLUS (TIMES X (SUB1 N)) Z)
(SUB1 N))
(TIMES X (SUB1 N))
Z)
(PLUS (PLUS (TIMES X (SUB1 N)) Z) X))
(SUB1 N))).
This further simplifies, appealing to the lemmas PLUS-COMMUTES1,
PLUS-COMMUTES2, PLUS-ASSOCIATES, TIMES-DISTRIBUTES1, TIMES-ASSOCIATES,
TIMES-DISTRIBUTES2, TIMES-COMMUTES1, NSIG*-UPPER-BOUND-HACK3, and
QUOTIENT-PLUS-TIMES3, and opening up the functions QUOTIENT, EQUAL, and
PLUS, to:
T.
Case 1. (IMPLIES (AND (NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(LESSP (SUB1 N) 17)
(LESSP W R)
(EQUAL N 0))
(EQUAL (QUOTIENT 0 R) (SUB1 N))),
which again simplifies, unfolding the functions NUMBERP, SUB1, LESSP, EQUAL,
and QUOTIENT, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
NSIG*-UPPER-BOUND-LEMMA2-2
(PROVE-LEMMA NSIG*-UPPER-BOUND-LEMMA2-EQUALITY
(REWRITE)
(IMPLIES (AND (NUMBERP N)
(NOT (ZEROP W))
(NOT (ZEROP R))
(RATE-PROXIMITY W R)
(LESSP N 18))
(EQUAL (QUOTIENT (TIMES N W) R)
(IF (LESSP W R) (SUB1 N) N)))
((DISABLE TIMES)
(USE (NSIG*-UPPER-BOUND-LEMMA2-1)
(NSIG*-UPPER-BOUND-LEMMA2-2))))
This conjecture can be simplified, using the abbreviations RATE-PROXIMITY,
ZEROP, NOT, IMPLIES, and AND, to the formula:
(IMPLIES (AND (IMPLIES (AND (NUMBERP N)
(NOT (ZEROP W))
(NOT (ZEROP R))
(RATE-PROXIMITY W R)
(LESSP N 18)
(NOT (LESSP W R)))
(EQUAL (QUOTIENT (TIMES N W) R) N))
(IMPLIES (AND (NUMBERP N)
(NOT (ZEROP W))
(NOT (ZEROP R))
(RATE-PROXIMITY W R)
(LESSP N 18)
(LESSP W R))
(EQUAL (QUOTIENT (TIMES N W) R)
(SUB1 N)))
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(EQUAL (QUOTIENT (TIMES N W) R)
(IF (LESSP W R) (SUB1 N) N))).
This simplifies, applying the lemma EQUAL-TIMES-0, and unfolding ZEROP, NOT,
RATE-PROXIMITY, SUB1, NUMBERP, EQUAL, LESSP, AND, IMPLIES, and QUOTIENT, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
NSIG*-UPPER-BOUND-LEMMA2-EQUALITY
(PROVE-LEMMA NSIG*-UPPER-BOUND-LEMMA2
(REWRITE)
(IMPLIES (AND (NUMBERP N)
(NOT (ZEROP W))
(NOT (ZEROP R))
(RATE-PROXIMITY W R)
(LESSP N 18))
(NOT (LESSP N (QUOTIENT (TIMES N W) R)))))
WARNING: Note that the proposed lemma NSIG*-UPPER-BOUND-LEMMA2 is to be
stored as zero type prescription rules, zero compound recognizer rules, one
linear rule, and zero replacement rules.
This conjecture can be simplified, using the abbreviations RATE-PROXIMITY,
ZEROP, NOT, AND, and IMPLIES, to the goal:
(IMPLIES (AND (NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(NOT (LESSP N (QUOTIENT (TIMES N W) R)))).
This simplifies, rewriting with NSIG*-UPPER-BOUND-LEMMA2-EQUALITY, and
unfolding the functions SUB1, NUMBERP, EQUAL, TIMES, and RATE-PROXIMITY, to
two new goals:
Case 2. (IMPLIES (AND (NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(LESSP N 18)
(NOT (LESSP W R)))
(NOT (LESSP N N))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(LESSP N 18)
(LESSP W R))
(NOT (LESSP N (SUB1 N)))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (EQUAL N 0)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(LESSP N 18)
(LESSP W R))
(NOT (LESSP N (SUB1 N)))).
This again simplifies, expanding the definitions of NUMBERP, LESSP, and SUB1,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NSIG*-UPPER-BOUND-LEMMA2
(PROVE-LEMMA NSIG*-LOWER-BOUND-LEMMA1
(REWRITE)
(IMPLIES (AND (NOT (ZEROP R))
(NOT (LESSP W TR-TS)))
(NOT (LESSP (QUOTIENT (DIFFERENCE (TIMES N W) TR-TS)
R)
(QUOTIENT (TIMES (SUB1 N) W) R)))))
WARNING: When the linear lemma NSIG*-LOWER-BOUND-LEMMA1 is stored under:
(QUOTIENT (TIMES (SUB1 N) W) R)
it contains the free variable TR-TS which will be chosen by instantiating the
hypothesis (NOT (LESSP W TR-TS)).
WARNING: Note that the proposed lemma NSIG*-LOWER-BOUND-LEMMA1 is to be
stored as zero type prescription rules, zero compound recognizer rules, two
linear rules, and zero replacement rules.
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to the new conjecture:
(IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP W TR-TS)))
(NOT (LESSP (QUOTIENT (DIFFERENCE (TIMES N W) TR-TS)
R)
(QUOTIENT (TIMES (SUB1 N) W) R)))),
which simplifies, rewriting with TIMES-COMMUTES1 and
LESSP-QUOTIENT-TO-LESSP-TIMES, and opening up the function TIMES, to the
following three new formulas:
Case 3. (IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP W TR-TS))
(NOT (EQUAL N 0))
(NUMBERP N))
(NOT (LESSP (DIFFERENCE (PLUS W (TIMES W (SUB1 N)))
TR-TS)
(TIMES R
(QUOTIENT (TIMES W (SUB1 N)) R))))).
This again simplifies, using linear arithmetic and applying
NOT-LESSP-TIMES-QUOTIENT, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP W TR-TS))
(EQUAL N 0))
(NOT (LESSP (DIFFERENCE 0 TR-TS)
(TIMES R
(QUOTIENT (TIMES W (SUB1 N)) R))))).
This again simplifies, using linear arithmetic, rewriting with the lemmas
DIFFERENCE-IS-0 and TIMES-COMMUTES1, and expanding the functions SUB1, EQUAL,
TIMES, LESSP, and QUOTIENT, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP W TR-TS))
(NOT (NUMBERP N)))
(NOT (LESSP (DIFFERENCE 0 TR-TS)
(TIMES R
(QUOTIENT (TIMES W (SUB1 N)) R))))),
which again simplifies, using linear arithmetic, rewriting with
DIFFERENCE-IS-0, SUB1-NNUMBERP, and TIMES-COMMUTES1, and expanding EQUAL,
TIMES, LESSP, and QUOTIENT, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NSIG*-LOWER-BOUND-LEMMA1
(PROVE-LEMMA LESSP-TIMES
(REWRITE)
(IMPLIES (NOT (ZEROP N))
(NOT (LESSP (TIMES N W) W))))
WARNING: Note that the proposed lemma LESSP-TIMES is to be stored as zero
type prescription rules, zero compound recognizer rules, one linear rule, and
zero replacement rules.
This formula can be simplified, using the abbreviations ZEROP, NOT, and
IMPLIES, to:
(IMPLIES (AND (NOT (EQUAL N 0)) (NUMBERP N))
(NOT (LESSP (TIMES N W) W))),
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 N) (p N W))
(IMPLIES (AND (NOT (ZEROP N)) (p (SUB1 N) W))
(p N W))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to show that the measure (COUNT N) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme produces three new conjectures:
Case 3. (IMPLIES (AND (ZEROP N)
(NOT (EQUAL N 0))
(NUMBERP N))
(NOT (LESSP (TIMES N W) W))),
which simplifies, opening up the definition of ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (SUB1 N) 0)
(NOT (EQUAL N 0))
(NUMBERP N))
(NOT (LESSP (TIMES N W) W))),
which simplifies, using linear arithmetic, rewriting with TIMES-MONOTONIC,
PLUS-ASSOCIATES, EQUAL-TIMES-0, TIMES-DISTRIBUTES1, and PLUS-COMMUTES1, and
opening up the functions PLUS, EQUAL, and TIMES, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP (TIMES (SUB1 N) W) W))
(NOT (EQUAL N 0))
(NUMBERP N))
(NOT (LESSP (TIMES N W) W))).
This simplifies, using linear arithmetic, rewriting with the lemmas
TIMES-MONOTONIC, PLUS-ASSOCIATES, and TIMES-DISTRIBUTES1, and opening up the
function TIMES, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-TIMES
(PROVE-LEMMA PLUS-CANCELLATION
(REWRITE)
(EQUAL (EQUAL (PLUS I J) (PLUS I K))
(EQUAL (FIX J) (FIX K))))
This conjecture simplifies, expanding the definition of FIX, to the following
seven new formulas:
Case 7. (IMPLIES (AND (NUMBERP K)
(NUMBERP J)
(NOT (EQUAL J K)))
(NOT (EQUAL (PLUS I J) (PLUS I K)))).
This again simplifies, using linear arithmetic, to:
T.
Case 6. (IMPLIES (AND (NUMBERP K)
(NOT (NUMBERP J))
(NOT (EQUAL 0 K)))
(NOT (EQUAL (PLUS I J) (PLUS I K)))),
which we will name *1.
Case 5. (IMPLIES (AND (NOT (NUMBERP K))
(NUMBERP J)
(NOT (EQUAL J 0)))
(NOT (EQUAL (PLUS I J) (PLUS I K)))),
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 I J) (PLUS I K))
(EQUAL (FIX J) (FIX K))).
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 I) (p I J K))
(IMPLIES (AND (NOT (ZEROP I)) (p (SUB1 I) 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 I) 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 I)
(EQUAL (EQUAL (PLUS I J) (PLUS I K))
(EQUAL (FIX J) (FIX K)))).
This simplifies, expanding the functions ZEROP, EQUAL, PLUS, and FIX, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP I))
(EQUAL (EQUAL (PLUS (SUB1 I) J)
(PLUS (SUB1 I) K))
(EQUAL (FIX J) (FIX K))))
(EQUAL (EQUAL (PLUS I J) (PLUS I K))
(EQUAL (FIX J) (FIX K)))).
This simplifies, rewriting with ADD1-EQUAL and PLUS-COMMUTES1, and unfolding
the definitions of ZEROP, FIX, PLUS, and EQUAL, to two new goals:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(NOT (NUMBERP K))
(EQUAL J 0)
(EQUAL (EQUAL (PLUS (SUB1 I) J)
(PLUS (SUB1 I) K))
T))
(EQUAL I (ADD1 (PLUS (SUB1 I) K)))),
which again simplifies, rewriting with the lemmas PLUS-COMMUTES1 and
ADD1-SUB1, and opening up EQUAL and PLUS, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL I 0))
(NUMBERP I)
(NOT (NUMBERP J))
(EQUAL 0 K)
(EQUAL (EQUAL (PLUS (SUB1 I) J)
(PLUS (SUB1 I) K))
T))
(EQUAL (ADD1 (PLUS (SUB1 I) J)) I)),
which again simplifies, appealing to the lemmas PLUS-COMMUTES1 and
ADD1-SUB1, and expanding EQUAL and PLUS, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
PLUS-CANCELLATION
(DEFN BOOLP
(X)
(OR (EQUAL X T) (EQUAL X F)))
Observe that (OR (FALSEP (BOOLP X)) (TRUEP (BOOLP X))) is a theorem.
[ 0.0 0.0 0.0 ]
BOOLP
(DISABLE BOOLP)
[ 0.0 0.0 0.0 ]
BOOLP-OFF
(PROVE-LEMMA BOOLP-T
(REWRITE)
(IMPLIES (AND (BOOLP X) X)
(EQUAL (EQUAL T X) T))
((ENABLE BOOLP)))
This simplifies, opening up the function BOOLP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
BOOLP-T
(DEFN B-NOT (X) (NOT X))
Observe that (OR (FALSEP (B-NOT X)) (TRUEP (B-NOT X))) is a theorem.
[ 0.0 0.0 0.0 ]
B-NOT
(DISABLE B-NOT)
[ 0.0 0.0 0.0 ]
B-NOT-OFF
(DEFN B-XOR
(X Y)
(IF X (NOT Y) (IF Y T F)))
From the definition we can conclude that:
(OR (FALSEP (B-XOR X Y))
(TRUEP (B-XOR X Y)))
is a theorem.
[ 0.0 0.0 0.0 ]
B-XOR
(DISABLE B-XOR)
[ 0.0 0.0 0.0 ]
B-XOR-OFF
(PROVE-LEMMA B-XOR-B-NOT
(REWRITE)
(AND (B-XOR X (B-NOT X))
(B-XOR (B-NOT X) X))
((ENABLE B-XOR B-NOT)))
WARNING: Note that the proposed lemma B-XOR-B-NOT 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 formulas:
Case 2. (B-XOR X (B-NOT X)).
This simplifies, opening up B-NOT and B-XOR, to:
T.
Case 1. (B-XOR (B-NOT X) X).
This simplifies, expanding the definitions of B-NOT and B-XOR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
B-XOR-B-NOT
(DEFN SMOOTH
(PREV-VAL LST)
(IF (NLISTP LST)
NIL
(IF (B-XOR PREV-VAL (CAR LST))
(CONS 'Q
(SMOOTH (CAR LST) (CDR LST)))
(CONS (CAR LST)
(SMOOTH (CAR LST) (CDR LST))))))
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT LST) decreases
according to the well-founded relation LESSP in each recursive call. Hence,
SMOOTH is accepted under the principle of definition. Note that:
(OR (LITATOM (SMOOTH PREV-VAL LST))
(LISTP (SMOOTH PREV-VAL LST)))
is a theorem.
[ 0.0 0.1 0.0 ]
SMOOTH
(DEFN RECONCILE-SIGNALS
(A B)
(IF (EQUAL A B) A 'Q))
Observe that:
(OR (LITATOM (RECONCILE-SIGNALS A B))
(EQUAL (RECONCILE-SIGNALS A B) A))
is a theorem.
[ 0.0 0.0 0.0 ]
RECONCILE-SIGNALS
(DEFN SIG
(LST TS TR W)
(IF (NLISTP LST)
'Q
(IF (LESSP (PLUS TS W) TR)
(RECONCILE-SIGNALS (CAR LST)
(SIG (CDR LST) (PLUS TS W) TR W))
(CAR LST))))
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP establish that the measure (COUNT LST) decreases
according to the well-founded relation LESSP in each recursive call. Hence,
SIG is accepted under the principle of definition.
[ 0.0 0.0 0.0 ]
SIG
(DEFN ENDP
(LST TS TR W)
(IF (NLISTP LST)
T
(IF (LESSP (PLUS TS W) TR)
(ENDP (CDR LST) (PLUS TS W) TR W)
F)))
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT LST) decreases
according to the well-founded relation LESSP in each recursive call. Hence,
ENDP is accepted under the definitional principle. Observe that:
(OR (FALSEP (ENDP LST TS TR W))
(TRUEP (ENDP LST TS TR W)))
is a theorem.
[ 0.0 0.0 0.0 ]
ENDP
(DEFN LST+
(LST TS NXTR W)
(IF (NLISTP LST)
LST
(IF (LESSP NXTR (PLUS TS W))
LST
(LST+ (CDR LST) (PLUS TS W) NXTR W))))
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP can be used to establish that the measure (COUNT LST)
decreases according to the well-founded relation LESSP in each recursive call.
Hence, LST+ is accepted under the principle of definition.
[ 0.0 0.0 0.0 ]
LST+
(DEFN TS+
(LST TS NXTR W)
(IF (NLISTP LST)
TS
(IF (LESSP NXTR (PLUS TS W))
TS
(TS+ (CDR LST) (PLUS TS W) NXTR W))))
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP can be used to establish that the measure (COUNT LST)
decreases according to the well-founded relation LESSP in each recursive call.
Hence, TS+ is accepted under the principle of definition. Note that:
(OR (NUMBERP (TS+ LST TS NXTR W))
(EQUAL (TS+ LST TS NXTR W) TS))
is a theorem.
[ 0.0 0.0 0.0 ]
TS+
(PROVE-LEMMA LST+-WEAKLY-SHORTENS-LST
(REWRITE)
(NOT (LESSP (COUNT LST)
(COUNT (LST+ LST TS TR W)))))
WARNING: Note that the proposed lemma LST+-WEAKLY-SHORTENS-LST is to be
stored as zero type prescription rules, zero compound recognizer rules, one
linear rule, and zero replacement rules.
Give the conjecture the name *1.
We will try to prove it by induction. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP LST) (p LST TS TR W))
(IMPLIES (AND (NOT (NLISTP LST))
(LESSP TR (PLUS TS W)))
(p LST TS TR W))
(IMPLIES (AND (NOT (NLISTP LST))
(NOT (LESSP TR (PLUS TS W)))
(p (CDR LST) (PLUS TS W) TR W))
(p LST TS TR W))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT LST) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for TS. The above induction scheme
generates three new goals:
Case 3. (IMPLIES (NLISTP LST)
(NOT (LESSP (COUNT LST)
(COUNT (LST+ LST TS TR W))))),
which simplifies, expanding NLISTP and LST+, to the goal:
(IMPLIES (NOT (LISTP LST))
(NOT (LESSP (COUNT LST) (COUNT LST)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (COUNT LST)
(COUNT (LST+ LST TS TR W))))),
which simplifies, unfolding the definitions of NLISTP and LST+, to the
formula:
(IMPLIES (AND (LISTP LST)
(LESSP TR (PLUS TS W)))
(NOT (LESSP (COUNT LST) (COUNT LST)))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST))
(NOT (LESSP TR (PLUS TS W)))
(NOT (LESSP (COUNT (CDR LST))
(COUNT (LST+ (CDR LST) (PLUS TS W) TR W)))))
(NOT (LESSP (COUNT LST)
(COUNT (LST+ LST TS TR W))))),
which simplifies, opening up the definitions of NLISTP and LST+, to:
(IMPLIES (AND (LISTP LST)
(NOT (LESSP TR (PLUS TS W)))
(NOT (LESSP (COUNT (CDR LST))
(COUNT (LST+ (CDR LST) (PLUS TS W) TR W)))))
(NOT (LESSP (COUNT LST)
(COUNT (LST+ (CDR LST) (PLUS TS W) TR W))))).
But this again simplifies, using linear arithmetic and rewriting with
CDR-LESSEQP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LST+-WEAKLY-SHORTENS-LST
(PROVE-LEMMA TS+-INCREASES-TR
(REWRITE)
(IMPLIES (AND (NOT (ENDP LST TS (PLUS R TR) W))
(NOT (ZEROP R))
(EQUAL (COUNT LST)
(COUNT (LST+ LST TS (PLUS R TR) W))))
(EQUAL (LESSP (DIFFERENCE (PLUS W (TS+ LST TS (PLUS R TR) W))
(PLUS R TR))
(DIFFERENCE (PLUS TS W) TR))
T))
((EXPAND (LST+ LST TS (PLUS R TR) W)
(TS+ LST TS (PLUS R TR) W))))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to the new conjecture:
(IMPLIES (AND (NOT (ENDP LST TS (PLUS R TR) W))
(NOT (EQUAL R 0))
(NUMBERP R)
(EQUAL (COUNT LST)
(COUNT (LST+ LST TS (PLUS R TR) W))))
(EQUAL (LESSP (DIFFERENCE (PLUS W (TS+ LST TS (PLUS R TR) W))
(PLUS R TR))
(DIFFERENCE (PLUS TS W) TR))
T)),
which simplifies, rewriting with PLUS-COMMUTES1, and opening up LST+ and TS+,
to the following five new conjectures:
Case 5. (IMPLIES (AND (NOT (ENDP LST TS (PLUS R TR) W))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LISTP LST)))
(LESSP (DIFFERENCE (PLUS TS W) (PLUS R TR))
(DIFFERENCE (PLUS TS W) TR))).
However this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP (PLUS TS W) (PLUS R TR))
(NOT (ENDP LST TS (PLUS R TR) W))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LISTP LST)))
(LESSP (DIFFERENCE (PLUS TS W) (PLUS R TR))
(DIFFERENCE (PLUS TS W) TR))).
This again simplifies, opening up the function ENDP, to:
T.
Case 4. (IMPLIES (AND (NOT (ENDP LST TS (PLUS R TR) W))
(NOT (EQUAL R 0))
(NUMBERP R)
(LESSP (PLUS R TR) (PLUS TS W)))
(LESSP (DIFFERENCE (PLUS TS W) (PLUS R TR))
(DIFFERENCE (PLUS TS W) TR))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP (PLUS TS W) (PLUS R TR))
(NOT (ENDP LST TS (PLUS R TR) W))
(NOT (EQUAL R 0))
(NUMBERP R)
(LESSP (PLUS R TR) (PLUS TS W)))
(LESSP (DIFFERENCE (PLUS TS W) (PLUS R TR))
(DIFFERENCE (PLUS TS W) TR))).
However this again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (NOT (ENDP LST TS (PLUS R TR) W))
(NOT (EQUAL R 0))
(NUMBERP R)
(EQUAL (COUNT LST)
(COUNT (LST+ (CDR LST)
(PLUS TS W)
(PLUS R TR)
W)))
(LESSP (PLUS R TR) (PLUS TS W)))
(LESSP (DIFFERENCE (PLUS W TS) (PLUS R TR))
(DIFFERENCE (PLUS TS W) TR))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP (PLUS W TS) (PLUS R TR))
(NOT (ENDP LST TS (PLUS R TR) W))
(NOT (EQUAL R 0))
(NUMBERP R)
(EQUAL (COUNT LST)
(COUNT (LST+ (CDR LST)
(PLUS TS W)
(PLUS R TR)
W)))
(LESSP (PLUS R TR) (PLUS TS W)))
(LESSP (DIFFERENCE (PLUS W TS) (PLUS R TR))
(DIFFERENCE (PLUS TS W) TR))).
This again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (ENDP LST TS (PLUS R TR) W))
(NOT (EQUAL R 0))
(NUMBERP R)
(EQUAL (COUNT LST)
(COUNT (LST+ (CDR LST)
(PLUS TS W)
(PLUS R TR)
W)))
(NOT (LISTP LST)))
(LESSP (DIFFERENCE (PLUS W TS) (PLUS R TR))
(DIFFERENCE (PLUS TS W) TR))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP (PLUS W TS) (PLUS R TR))
(NOT (ENDP LST TS (PLUS R TR) W))
(NOT (EQUAL R 0))
(NUMBERP R)
(EQUAL (COUNT LST)
(COUNT (LST+ (CDR LST)
(PLUS TS W)
(PLUS R TR)
W)))
(NOT (LISTP LST)))
(LESSP (DIFFERENCE (PLUS W TS) (PLUS R TR))
(DIFFERENCE (PLUS TS W) TR))).
However this again simplifies, applying PLUS-COMMUTES1, and opening up the
function ENDP, to:
T.
Case 1. (IMPLIES (AND (NOT (ENDP LST TS (PLUS R TR) W))
(NOT (EQUAL R 0))
(NUMBERP R)
(EQUAL (COUNT LST)
(COUNT (LST+ (CDR LST)
(PLUS TS W)
(PLUS R TR)
W)))
(LISTP LST)
(NOT (LESSP (PLUS R TR) (PLUS TS W))))
(LESSP (DIFFERENCE (PLUS W
(TS+ (CDR LST)
(PLUS TS W)
(PLUS R TR)
W))
(PLUS R TR))
(DIFFERENCE (PLUS TS W) TR))).
But this again simplifies, using linear arithmetic and rewriting with the
lemmas CDR-LESSP and LST+-WEAKLY-SHORTENS-LST, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
TS+-INCREASES-TR
(DEFN WARP
(LST TS TR W R)
(IF (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W))
NIL
(CONS (SIG LST TS (PLUS TR R) W)
(WARP (LST+ LST TS (PLUS TR R) W)
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R)))
((ORD-LESSP (CONS (CONS (ADD1 (COUNT LST)) 0)
(DIFFERENCE (PLUS TS W) TR)))))
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, TS+-INCREASES-TR,
SUB1-ADD1, ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and
LST+-WEAKLY-SHORTENS-LST, and the definitions of LISTP, ORDINALP, LESSP,
ORD-LESSP, EQUAL, OR, and ZEROP establish that the measure:
(CONS (CONS (ADD1 (COUNT LST)) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each recursive
call. Hence, WARP is accepted under the principle of definition. From the
definition we can conclude that:
(OR (LITATOM (WARP LST TS TR W R))
(LISTP (WARP LST TS TR W R)))
is a theorem.
[ 0.0 0.0 0.0 ]
WARP
(DEFN DET
(LST ORACLE)
(IF (NLISTP LST)
LST
(IF (EQUAL (CAR LST) 'Q)
(CONS (IF (CAR ORACLE) T F)
(DET (CDR LST) (CDR ORACLE)))
(CONS (CAR LST)
(DET (CDR LST) ORACLE)))))
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP can be used to establish that the measure (COUNT LST)
decreases according to the well-founded relation LESSP in each recursive call.
Hence, DET is accepted under the definitional principle. Note that:
(OR (LISTP (DET LST ORACLE))
(EQUAL (DET LST ORACLE) LST))
is a theorem.
[ 0.0 0.0 0.0 ]
DET
(DEFN ASYNC
(LST TS TR W R ORACLE)
(DET (WARP (SMOOTH T LST) TS TR W R)
ORACLE))
Note that:
(OR (LITATOM (ASYNC LST TS TR W R ORACLE))
(LISTP (ASYNC LST TS TR W R ORACLE)))
is a theorem.
[ 0.0 0.0 0.0 ]
ASYNC
(DEFN LISTN
(N VALUE)
(IF (ZEROP N)
NIL
(CONS VALUE (LISTN (SUB1 N) VALUE))))
Linear arithmetic, the lemma 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, LISTN is accepted under the
definitional principle. From the definition we can conclude that:
(OR (LITATOM (LISTN N VALUE))
(LISTP (LISTN N VALUE)))
is a theorem.
[ 0.0 0.0 0.0 ]
LISTN
(DEFN CSIG
(PREV-SIGNAL BIT)
(IF BIT PREV-SIGNAL
(B-NOT PREV-SIGNAL)))
Observe that:
(OR (OR (FALSEP (CSIG PREV-SIGNAL BIT))
(TRUEP (CSIG PREV-SIGNAL BIT)))
(EQUAL (CSIG PREV-SIGNAL BIT)
PREV-SIGNAL))
is a theorem.
[ 0.0 0.0 0.0 ]
CSIG
(DEFN CELL
(PREV-SIGNAL N1 N2 BIT)
(APP (LISTN N1 (B-NOT PREV-SIGNAL))
(LISTN N2 (CSIG PREV-SIGNAL BIT))))
Note that:
(OR (LITATOM (CELL PREV-SIGNAL N1 N2 BIT))
(LISTP (CELL PREV-SIGNAL N1 N2 BIT)))
is a theorem.
[ 0.0 0.0 0.0 ]
CELL
(DEFN CELLS
(PREV-SIGNAL N1 N2 MSG)
(IF (NLISTP MSG)
NIL
(APP (CELL PREV-SIGNAL N1 N2 (CAR MSG))
(CELLS (CSIG PREV-SIGNAL (CAR MSG))
N1 N2
(CDR MSG)))))
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT MSG) decreases
according to the well-founded relation LESSP in each recursive call. Hence,
CELLS is accepted under the definitional principle. Observe that:
(OR (LITATOM (CELLS PREV-SIGNAL N1 N2 MSG))
(LISTP (CELLS PREV-SIGNAL N1 N2 MSG)))
is a theorem.
[ 0.0 0.0 0.0 ]
CELLS
(DEFN SEND
(MSG PAD1 N1 N2 PAD2)
(APP (LISTN PAD1 T)
(APP (CELLS T N1 N2 MSG)
(LISTN PAD2 T))))
Observe that:
(OR (LITATOM (SEND MSG PAD1 N1 N2 PAD2))
(LISTP (SEND MSG PAD1 N1 N2 PAD2)))
is a theorem.
[ 0.0 0.0 0.0 ]
SEND
(DEFN SCAN
(PREV-SIGNAL LST)
(IF (NLISTP LST)
NIL
(IF (B-XOR PREV-SIGNAL (CAR LST))
LST
(SCAN PREV-SIGNAL (CDR LST)))))
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP can be used to establish that the measure (COUNT LST)
decreases according to the well-founded relation LESSP in each recursive call.
Hence, SCAN is accepted under the principle of definition. Note that:
(OR (LITATOM (SCAN PREV-SIGNAL LST))
(LISTP (SCAN PREV-SIGNAL LST)))
is a theorem.
[ 0.0 0.0 0.0 ]
SCAN
(DEFN CDRN
(N LST)
(IF (ZEROP N)
LST
(CDRN (SUB1 N) (CDR LST))))
Linear arithmetic, the lemma 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, CDRN is accepted under the
principle of definition.
[ 0.0 0.0 0.0 ]
CDRN
(DEFN NTH (N LST) (CAR (CDRN N LST)))
[ 0.0 0.0 0.0 ]
NTH
(DEFN RECV-BIT
(K LST)
(IF (B-XOR (CAR LST) (NTH K LST))
T F))
Note that (OR (FALSEP (RECV-BIT K LST)) (TRUEP (RECV-BIT K LST))) is a
theorem.
[ 0.0 0.0 0.0 ]
RECV-BIT
(DEFN RECV
(I FLG K LST)
(IF (ZEROP I)
NIL
(CONS (RECV-BIT K (SCAN FLG LST))
(RECV (SUB1 I)
(NTH K (SCAN FLG LST))
K
(CDRN K (SCAN FLG LST))))))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
inform us that the measure (COUNT I) decreases according to the well-founded
relation LESSP in each recursive call. Hence, RECV is accepted under the
definitional principle. Observe that:
(OR (LITATOM (RECV I FLG K LST))
(LISTP (RECV I FLG K LST)))
is a theorem.
[ 0.0 0.0 0.0 ]
RECV
(DEFN BVP
(X)
(IF (NLISTP X)
(EQUAL X NIL)
(AND (BOOLP (CAR X)) (BVP (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, BVP is
accepted under the principle of definition. Note that:
(OR (FALSEP (BVP X)) (TRUEP (BVP X)))
is a theorem.
[ 0.0 0.0 0.0 ]
BVP
(DISABLE LISTN)
[ 0.0 0.0 0.0 ]
LISTN-OFF
(DISABLE *1*LISTN)
[ 0.0 0.0 0.0 ]
G*1*LISTN-OFF
(DISABLE CELL)
[ 0.0 0.0 0.0 ]
CELL-OFF
(DISABLE *1*CELL)
[ 0.0 0.0 0.0 ]
G*1*CELL-OFF
(DISABLE CSIG)
[ 0.0 0.0 0.0 ]
CSIG-OFF
(DISABLE *1*CSIG)
[ 0.0 0.0 0.0 ]
G*1*CSIG-OFF
(DISABLE BOOLP)
[ 0.0 0.0 0.0 ]
BOOLP-OFF1
(DISABLE SMOOTH)
[ 0.0 0.0 0.0 ]
SMOOTH-OFF
(DISABLE WARP)
[ 0.0 0.0 0.0 ]
WARP-OFF
(DISABLE DET)
[ 0.0 0.0 0.0 ]
DET-OFF
(DISABLE RECV-BIT)
[ 0.0 0.0 0.0 ]
RECV-BIT-OFF
(DISABLE SCAN)
[ 0.0 0.0 0.0 ]
SCAN-OFF
(DISABLE SEND)
[ 0.0 0.0 0.0 ]
SEND-OFF
(PROVE-LEMMA B-XOR-X-X
(REWRITE)
(NOT (B-XOR X X))
((ENABLE B-XOR)))
This conjecture simplifies, opening up the definition of B-XOR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
B-XOR-X-X
(DEFN LST*
(LST TS TR W R)
(IF (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W))
LST
(LST* (LST+ LST TS (PLUS TR R) W)
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R))
((ORD-LESSP (CONS (CONS (ADD1 (COUNT LST)) 0)
(DIFFERENCE (PLUS TS W) TR)))))
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, TS+-INCREASES-TR,
SUB1-ADD1, ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and
LST+-WEAKLY-SHORTENS-LST, and the definitions of LISTP, ORDINALP, LESSP,
ORD-LESSP, EQUAL, OR, and ZEROP inform us that the measure:
(CONS (CONS (ADD1 (COUNT LST)) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each recursive
call. Hence, LST* is accepted under the definitional principle.
[ 0.0 0.0 0.0 ]
LST*
(DEFN TS*
(LST TS TR W R)
(IF (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W))
TS
(TS* (LST+ LST TS (PLUS TR R) W)
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R))
((ORD-LESSP (CONS (CONS (ADD1 (COUNT LST)) 0)
(DIFFERENCE (PLUS TS W) TR)))))
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, TS+-INCREASES-TR,
SUB1-ADD1, ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and
LST+-WEAKLY-SHORTENS-LST, and the definitions of LISTP, ORDINALP, LESSP,
ORD-LESSP, EQUAL, OR, and ZEROP inform us that the measure:
(CONS (CONS (ADD1 (COUNT LST)) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each recursive
call. Hence, TS* is accepted under the definitional principle. From the
definition we can conclude that:
(OR (NUMBERP (TS* LST TS TR W R))
(EQUAL (TS* LST TS TR W R) TS))
is a theorem.
[ 0.0 0.0 0.0 ]
TS*
(DEFN TR*
(LST TS TR W R)
(IF (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W))
TR
(TR* (LST+ LST TS (PLUS TR R) W)
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R))
((ORD-LESSP (CONS (CONS (ADD1 (COUNT LST)) 0)
(DIFFERENCE (PLUS TS W) TR)))))
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, TS+-INCREASES-TR,
SUB1-ADD1, ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and
LST+-WEAKLY-SHORTENS-LST, and the definitions of LISTP, ORDINALP, LESSP,
ORD-LESSP, EQUAL, OR, and ZEROP inform us that the measure:
(CONS (CONS (ADD1 (COUNT LST)) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each recursive
call. Hence, TR* is accepted under the definitional principle. From the
definition we can conclude that:
(OR (NUMBERP (TR* LST TS TR W R))
(EQUAL (TR* LST TS TR W R) TR))
is a theorem.
[ 0.0 0.0 0.0 ]
TR*
(PROVE-LEMMA NOT-LESSP-TS+
(REWRITE)
(IMPLIES (AND (NOT (LESSP TR TS))
(NOT (ZEROP W)))
(NOT (LESSP TR (TS+ LST TS TR W)))))
WARNING: Note that the proposed lemma NOT-LESSP-TS+ is to be stored as zero
type prescription rules, zero compound recognizer rules, one linear rule, and
zero replacement rules.
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to the new formula:
(IMPLIES (AND (NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (LESSP TR (TS+ LST TS TR W)))),
which we will 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 LST) (p TR LST TS W))
(IMPLIES (AND (NOT (NLISTP LST))
(LESSP TR (PLUS TS W)))
(p TR LST TS W))
(IMPLIES (AND (NOT (NLISTP LST))
(NOT (LESSP TR (PLUS TS W)))
(p TR (CDR LST) (PLUS TS W) W))
(p TR LST TS W))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT LST) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for TS. The above induction scheme
leads to the following three new formulas:
Case 3. (IMPLIES (AND (NLISTP LST)
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (LESSP TR (TS+ LST TS TR W)))).
This simplifies, unfolding the functions NLISTP and TS+, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST))
(LESSP TR (PLUS TS W))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (LESSP TR (TS+ LST TS TR W)))).
This simplifies, unfolding the definitions of NLISTP and TS+, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST))
(NOT (LESSP TR (PLUS TS W)))
(NOT (LESSP TR
(TS+ (CDR LST) (PLUS TS W) TR W)))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (LESSP TR (TS+ LST TS TR W)))).
This simplifies, unfolding the definitions of NLISTP and TS+, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
NOT-LESSP-TS+
(PROVE-LEMMA LESSP-TS+
(REWRITE)
(IMPLIES (AND (NOT (ENDP LST TS TR W))
(NOT (LESSP TR TS))
(NOT (ZEROP W)))
(LESSP TR
(PLUS W (TS+ LST TS TR W)))))
WARNING: Note that the proposed lemma LESSP-TS+ is to be stored as zero type
prescription rules, zero compound recognizer rules, one linear rule, and zero
replacement rules.
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to the formula:
(IMPLIES (AND (NOT (ENDP LST TS TR W))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP TR
(PLUS W (TS+ LST TS TR W)))).
Call the above conjecture *1.
Perhaps we can prove it by induction. There are six plausible inductions.
They merge into three likely candidate inductions. However, only one is
unflawed. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP LST) (p TR W LST TS))
(IMPLIES (AND (NOT (NLISTP LST))
(LESSP (PLUS TS W) TR)
(p TR W (CDR LST) (PLUS TS W)))
(p TR W LST TS))
(IMPLIES (AND (NOT (NLISTP LST))
(NOT (LESSP (PLUS TS W) TR)))
(p TR W LST TS))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT LST) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for TS. The above induction scheme
leads to the following five new goals:
Case 5. (IMPLIES (AND (NLISTP LST)
(NOT (ENDP LST TS TR W))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP TR
(PLUS W (TS+ LST TS TR W)))).
This simplifies, opening up NLISTP and ENDP, to:
T.
Case 4. (IMPLIES (AND (NOT (NLISTP LST))
(LESSP (PLUS TS W) TR)
(ENDP (CDR LST) (PLUS TS W) TR W)
(NOT (ENDP LST TS TR W))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP TR
(PLUS W (TS+ LST TS TR W)))).
This simplifies, expanding NLISTP and ENDP, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP LST))
(LESSP (PLUS TS W) TR)
(LESSP TR (PLUS TS W))
(NOT (ENDP LST TS TR W))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP TR
(PLUS W (TS+ LST TS TR W)))).
This simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST))
(LESSP (PLUS TS W) TR)
(LESSP TR
(PLUS W
(TS+ (CDR LST) (PLUS TS W) TR W)))
(NOT (ENDP LST TS TR W))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP TR
(PLUS W (TS+ LST TS TR W)))).
This simplifies, expanding the functions NLISTP, ENDP, and TS+, to:
(IMPLIES (AND (LISTP LST)
(LESSP (PLUS TS W) TR)
(LESSP TR
(PLUS W
(TS+ (CDR LST) (PLUS TS W) TR W)))
(NOT (ENDP (CDR LST) (PLUS TS W) TR W))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TR (PLUS TS W)))
(LESSP TR (PLUS W TS))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST))
(NOT (LESSP (PLUS TS W) TR))
(NOT (ENDP LST TS TR W))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP TR
(PLUS W (TS+ LST TS TR W)))),
which simplifies, expanding the functions NLISTP, ENDP, and TS+, to two new
conjectures:
Case 1.2.
(IMPLIES (AND (LISTP LST)
(NOT (LESSP (PLUS TS W) TR))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR (PLUS TS W))))
(LESSP TR
(PLUS W
(TS+ (CDR LST) (PLUS TS W) TR W)))),
which again simplifies, using linear arithmetic, to two new formulas:
Case 1.2.2.
(IMPLIES (AND (NOT (NUMBERP TR))
(LISTP LST)
(NOT (LESSP (PLUS TS W) TR))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR (PLUS TS W))))
(LESSP TR
(PLUS W
(TS+ (CDR LST) (PLUS TS W) TR W)))),
which again simplifies, unfolding the definitions of LESSP, EQUAL, and
PLUS, to:
T.
Case 1.2.1.
(IMPLIES (AND (NUMBERP TR)
(LISTP LST)
(NOT (LESSP (PLUS TS W) (PLUS W TS)))
(NOT (LESSP (PLUS W TS) TS))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS W TS) (PLUS TS W))))
(LESSP (PLUS W TS)
(PLUS W
(TS+ (CDR LST)
(PLUS TS W)
(PLUS W TS)
W)))),
which again simplifies, rewriting with PLUS-COMMUTES1, to:
(IMPLIES (AND (NUMBERP TR)
(LISTP LST)
(NOT (LESSP (PLUS TS W) (PLUS TS W)))
(NOT (LESSP (PLUS TS W) TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP (PLUS TS W)
(PLUS W
(TS+ (CDR LST)
(PLUS TS W)
(PLUS TS W)
W)))).
Applying the lemma CAR-CDR-ELIM, replace LST by (CONS Z X) to eliminate
(CDR LST) and (CAR LST). We thus obtain:
(IMPLIES (AND (NUMBERP TR)
(NOT (LESSP (PLUS TS W) (PLUS TS W)))
(NOT (LESSP (PLUS TS W) TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP (PLUS TS W)
(PLUS W
(TS+ X (PLUS TS W) (PLUS TS W) W)))),
which we generalize by replacing (PLUS TS W) by Y. We restrict the new
variable by recalling the type restriction lemma noted when PLUS was
introduced. We would thus like to prove:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP TR)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W (TS+ X Y Y W)))),
which has an irrelevant term in it. By eliminating the term we get the
new goal:
(IMPLIES (AND (NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W (TS+ X Y Y W)))),
which we will finally name *1.1.
Case 1.1.
(IMPLIES (AND (LISTP LST)
(NOT (LESSP (PLUS TS W) TR))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TR (PLUS TS W)))
(LESSP TR (PLUS W TS))).
This again simplifies, using linear arithmetic, to:
T.
So we now return to:
(IMPLIES (AND (NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W (TS+ X Y Y W)))),
which we named *1.1 above. 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 (NLISTP X) (p Y W X TS))
(IMPLIES (AND (NOT (NLISTP X))
(LESSP Y (PLUS Y W)))
(p Y W X TS))
(IMPLIES (AND (NOT (NLISTP X))
(NOT (LESSP Y (PLUS Y W)))
(p (PLUS Y W) W (CDR X) TS))
(p Y W X TS))).
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
generates five new goals:
Case 5. (IMPLIES (AND (NLISTP X)
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W (TS+ X Y Y W)))),
which simplifies, expanding the functions NLISTP and TS+, to:
(IMPLIES (AND (NOT (LISTP X))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W Y))).
However this again simplifies, using linear arithmetic, to:
T.
Case 4. (IMPLIES (AND (NOT (NLISTP X))
(LESSP Y (PLUS Y W))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W (TS+ X Y Y W)))),
which simplifies, applying PLUS-COMMUTES1, and unfolding NLISTP and TS+, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP X))
(NOT (LESSP Y (PLUS Y W)))
(LESSP (PLUS Y W) (PLUS Y W))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W (TS+ X Y Y W)))).
This simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP X))
(NOT (LESSP Y (PLUS Y W)))
(LESSP (PLUS Y W) TS)
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W (TS+ X Y Y W)))).
This simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP X))
(NOT (LESSP Y (PLUS Y W)))
(LESSP (PLUS Y W)
(PLUS W
(TS+ (CDR X)
(PLUS Y W)
(PLUS Y W)
W)))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W (TS+ X Y Y W)))).
This simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1.1, which, consequently, also finishes the
proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
LESSP-TS+
(PROVE-LEMMA LST+-APP
(REWRITE)
(IMPLIES (AND (NOT (ENDP LST1 TS TR+ W))
(NOT (ZEROP W)))
(EQUAL (LST+ (APP LST1 LST2) TS TR+ W)
(APP (LST+ LST1 TS TR+ W) LST2))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to the formula:
(IMPLIES (AND (NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (APP LST1 LST2) TS TR+ W)
(APP (LST+ LST1 TS TR+ W) LST2))).
Call the above conjecture *1.
Perhaps we can prove it by induction. There are three plausible
inductions. However, they merge into one likely candidate induction. We will
induct according to the following scheme:
(AND (IMPLIES (NLISTP LST1)
(p LST1 LST2 TS TR+ W))
(IMPLIES (AND (NOT (NLISTP LST1))
(LESSP (PLUS TS W) TR+)
(p (CDR LST1) LST2 (PLUS TS W) TR+ W))
(p LST1 LST2 TS TR+ W))
(IMPLIES (AND (NOT (NLISTP LST1))
(NOT (LESSP (PLUS TS W) TR+)))
(p LST1 LST2 TS TR+ W))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT LST1) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for TS. The above induction scheme
leads to the following four new goals:
Case 4. (IMPLIES (AND (NLISTP LST1)
(NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (APP LST1 LST2) TS TR+ W)
(APP (LST+ LST1 TS TR+ W) LST2))).
This simplifies, opening up NLISTP and ENDP, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP LST1))
(LESSP (PLUS TS W) TR+)
(ENDP (CDR LST1) (PLUS TS W) TR+ W)
(NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (APP LST1 LST2) TS TR+ W)
(APP (LST+ LST1 TS TR+ W) LST2))).
This simplifies, expanding NLISTP and ENDP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST1))
(LESSP (PLUS TS W) TR+)
(EQUAL (LST+ (APP (CDR LST1) LST2)
(PLUS TS W)
TR+ W)
(APP (LST+ (CDR LST1) (PLUS TS W) TR+ W)
LST2))
(NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (APP LST1 LST2) TS TR+ W)
(APP (LST+ LST1 TS TR+ W) LST2))).
This simplifies, rewriting with CDR-CONS, and unfolding the definitions of
NLISTP, ENDP, APP, and LST+, to the conjecture:
(IMPLIES (AND (LISTP LST1)
(LESSP (PLUS TS W) TR+)
(EQUAL (LST+ (APP (CDR LST1) LST2)
(PLUS TS W)
TR+ W)
(APP (LST+ (CDR LST1) (PLUS TS W) TR+ W)
LST2))
(NOT (ENDP (CDR LST1) (PLUS TS W) TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TR+ (PLUS TS W)))
(EQUAL (CONS (CAR LST1)
(APP (CDR LST1) LST2))
(APP LST1 LST2))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST1))
(NOT (LESSP (PLUS TS W) TR+))
(NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (APP LST1 LST2) TS TR+ W)
(APP (LST+ LST1 TS TR+ W) LST2))),
which simplifies, applying CDR-CONS, and expanding the functions NLISTP,
ENDP, APP, and LST+, to the following two new formulas:
Case 1.2.
(IMPLIES (AND (LISTP LST1)
(NOT (LESSP (PLUS TS W) TR+))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR+ (PLUS TS W))))
(EQUAL (LST+ (APP (CDR LST1) LST2)
(PLUS TS W)
TR+ W)
(APP (LST+ (CDR LST1) (PLUS TS W) TR+ W)
LST2))).
This again simplifies, using linear arithmetic, to two new conjectures:
Case 1.2.2.
(IMPLIES (AND (NOT (NUMBERP TR+))
(LISTP LST1)
(NOT (LESSP (PLUS TS W) TR+))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR+ (PLUS TS W))))
(EQUAL (LST+ (APP (CDR LST1) LST2)
(PLUS TS W)
TR+ W)
(APP (LST+ (CDR LST1) (PLUS TS W) TR+ W)
LST2))),
which again simplifies, unfolding the definitions of LESSP, PLUS, EQUAL,
and LST+, to:
(IMPLIES (AND (NOT (NUMBERP TR+))
(LISTP LST1)
(NOT (EQUAL W 0))
(NUMBERP W)
(EQUAL (PLUS TS W) 0))
(EQUAL (APP (CDR LST1) LST2)
(APP (LST+ (CDR LST1) (PLUS TS W) TR+ W)
LST2))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.2.1.
(IMPLIES (AND (NUMBERP TR+)
(LISTP LST1)
(NOT (LESSP (PLUS TS W) (PLUS W TS)))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS W TS) (PLUS TS W))))
(EQUAL (LST+ (APP (CDR LST1) LST2)
(PLUS TS W)
(PLUS W TS)
W)
(APP (LST+ (CDR LST1)
(PLUS TS W)
(PLUS W TS)
W)
LST2))),
which again simplifies, applying PLUS-COMMUTES1, to:
(IMPLIES (AND (NUMBERP TR+)
(LISTP LST1)
(NOT (LESSP (PLUS TS W) (PLUS TS W)))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (APP (CDR LST1) LST2)
(PLUS TS W)
(PLUS TS W)
W)
(APP (LST+ (CDR LST1)
(PLUS TS W)
(PLUS TS W)
W)
LST2))).
Applying the lemma CAR-CDR-ELIM, replace LST1 by (CONS Z X) to eliminate
(CDR LST1) and (CAR LST1). We would thus like to prove the new goal:
(IMPLIES (AND (NUMBERP TR+)
(NOT (LESSP (PLUS TS W) (PLUS TS W)))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (APP X LST2)
(PLUS TS W)
(PLUS TS W)
W)
(APP (LST+ X (PLUS TS W) (PLUS TS W) W)
LST2))),
which we generalize by replacing (PLUS TS W) by Y. We restrict the new
variable by recalling the type restriction lemma noted when PLUS was
introduced. This produces:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP TR+)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (APP X LST2) Y Y W)
(APP (LST+ X Y Y W) LST2))),
which has an irrelevant term in it. By eliminating the term we get the
new conjecture:
(IMPLIES (AND (NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (APP X LST2) Y Y W)
(APP (LST+ X Y Y W) LST2))),
which we will finally name *1.1.
Case 1.1.
(IMPLIES (AND (LISTP LST1)
(NOT (LESSP (PLUS TS W) TR+))
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TR+ (PLUS TS W)))
(EQUAL (CONS (CAR LST1)
(APP (CDR LST1) LST2))
(APP LST1 LST2))).
But this again simplifies, expanding the function APP, to:
T.
So let us turn our attention to:
(IMPLIES (AND (NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (APP X LST2) Y Y W)
(APP (LST+ X Y Y W) LST2))),
which we named *1.1 above. Let us appeal to the induction principle. 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 LST2 Y W))
(IMPLIES (AND (NOT (NLISTP X))
(p (CDR X) LST2 (PLUS Y W) W))
(p X LST2 Y W))).
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
generates three new formulas:
Case 3. (IMPLIES (AND (NLISTP X)
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (APP X LST2) Y Y W)
(APP (LST+ X Y Y W) LST2))),
which simplifies, unfolding the definitions of NLISTP, APP, and LST+, to:
(IMPLIES (AND (NOT (LISTP X))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ LST2 Y Y W) LST2)).
Eliminate the irrelevant term. This produces:
(IMPLIES (AND (NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ LST2 Y Y W) LST2)),
which we will name *1.1.1.
Case 2. (IMPLIES (AND (NOT (NLISTP X))
(LESSP (PLUS Y W) (PLUS Y W))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (APP X LST2) Y Y W)
(APP (LST+ X Y Y W) LST2))).
This simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP X))
(EQUAL (LST+ (APP (CDR X) LST2)
(PLUS Y W)
(PLUS Y W)
W)
(APP (LST+ (CDR X) (PLUS Y W) (PLUS Y W) W)
LST2))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (APP X LST2) Y Y W)
(APP (LST+ X Y Y W) LST2))).
This simplifies, rewriting with the lemmas PLUS-COMMUTES1 and CDR-CONS, and
unfolding the functions NLISTP, APP, and LST+, to the following two new
goals:
Case 1.2.
(IMPLIES (AND (LISTP X)
(EQUAL (LST+ (APP (CDR X) LST2)
(PLUS W Y)
(PLUS W Y)
W)
(APP (LST+ (CDR X) (PLUS Y W) (PLUS Y W) W)
LST2))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP Y (PLUS W Y))))
(EQUAL (LST+ (APP (CDR X) LST2)
(PLUS W Y)
Y W)
(APP (LST+ (CDR X) (PLUS W Y) Y W)
LST2))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (LISTP X)
(EQUAL (LST+ (APP (CDR X) LST2)
(PLUS W Y)
(PLUS W Y)
W)
(APP (LST+ (CDR X) (PLUS Y W) (PLUS Y W) W)
LST2))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP Y (PLUS W Y)))
(EQUAL (CONS (CAR X) (APP (CDR X) LST2))
(APP X LST2))),
which again simplifies, opening up the function APP, to:
T.
So we now return to:
(IMPLIES (AND (NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ LST2 Y Y W) LST2)),
which is formula *1.1.1 above. We will try to 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 (NLISTP LST2) (p LST2 Y W))
(IMPLIES (AND (NOT (NLISTP LST2))
(LESSP Y (PLUS Y W)))
(p LST2 Y W))
(IMPLIES (AND (NOT (NLISTP LST2))
(NOT (LESSP Y (PLUS Y W)))
(p (CDR LST2) (PLUS Y W) W))
(p LST2 Y W))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP establish that the measure (COUNT LST2) 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 four new goals:
Case 4. (IMPLIES (AND (NLISTP LST2)
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ LST2 Y Y W) LST2)),
which simplifies, unfolding NLISTP and LST+, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP LST2))
(LESSP Y (PLUS Y W))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ LST2 Y Y W) LST2)),
which simplifies, appealing to the lemma PLUS-COMMUTES1, and expanding the
definitions of NLISTP and LST+, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST2))
(NOT (LESSP Y (PLUS Y W)))
(LESSP (PLUS Y W) (PLUS Y W))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ LST2 Y Y W) LST2)),
which simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST2))
(NOT (LESSP Y (PLUS Y W)))
(EQUAL (LST+ (CDR LST2)
(PLUS Y W)
(PLUS Y W)
W)
(CDR LST2))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ LST2 Y Y W) LST2)),
which simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1.1.1, which, consequently, finishes the
proof of *1.1, which finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
LST+-APP
(PROVE-LEMMA TS+-APP
(REWRITE)
(IMPLIES (AND (NOT (ENDP LST1 TS TR+ W))
(NOT (ZEROP W)))
(EQUAL (TS+ (APP LST1 LST2) TS TR+ W)
(TS+ LST1 TS TR+ W))))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ (APP LST1 LST2) TS TR+ W)
(TS+ LST1 TS TR+ W))),
which we will name *1.
Perhaps we can prove it by induction. Three 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 LST1)
(p LST1 LST2 TS TR+ W))
(IMPLIES (AND (NOT (NLISTP LST1))
(LESSP (PLUS TS W) TR+)
(p (CDR LST1) LST2 (PLUS TS W) TR+ W))
(p LST1 LST2 TS TR+ W))
(IMPLIES (AND (NOT (NLISTP LST1))
(NOT (LESSP (PLUS TS W) TR+)))
(p LST1 LST2 TS TR+ W))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT LST1) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for TS. The above induction scheme
generates the following four new formulas:
Case 4. (IMPLIES (AND (NLISTP LST1)
(NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ (APP LST1 LST2) TS TR+ W)
(TS+ LST1 TS TR+ W))).
This simplifies, unfolding the functions NLISTP and ENDP, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP LST1))
(LESSP (PLUS TS W) TR+)
(ENDP (CDR LST1) (PLUS TS W) TR+ W)
(NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ (APP LST1 LST2) TS TR+ W)
(TS+ LST1 TS TR+ W))).
This simplifies, expanding the functions NLISTP and ENDP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST1))
(LESSP (PLUS TS W) TR+)
(EQUAL (TS+ (APP (CDR LST1) LST2)
(PLUS TS W)
TR+ W)
(TS+ (CDR LST1) (PLUS TS W) TR+ W))
(NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ (APP LST1 LST2) TS TR+ W)
(TS+ LST1 TS TR+ W))).
This simplifies, applying CDR-CONS, and unfolding the functions NLISTP, ENDP,
APP, and TS+, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST1))
(NOT (LESSP (PLUS TS W) TR+))
(NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ (APP LST1 LST2) TS TR+ W)
(TS+ LST1 TS TR+ W))),
which simplifies, applying CDR-CONS, and opening up the functions NLISTP,
ENDP, APP, and TS+, to:
(IMPLIES (AND (LISTP LST1)
(NOT (LESSP (PLUS TS W) TR+))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR+ (PLUS TS W))))
(EQUAL (TS+ (APP (CDR LST1) LST2)
(PLUS TS W)
TR+ W)
(TS+ (CDR LST1) (PLUS TS W) TR+ W))),
which again simplifies, using linear arithmetic, to two new goals:
Case 1.2.
(IMPLIES (AND (NOT (NUMBERP TR+))
(LISTP LST1)
(NOT (LESSP (PLUS TS W) TR+))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR+ (PLUS TS W))))
(EQUAL (TS+ (APP (CDR LST1) LST2)
(PLUS TS W)
TR+ W)
(TS+ (CDR LST1) (PLUS TS W) TR+ W))),
which again simplifies, expanding LESSP, PLUS, EQUAL, and TS+, to the
conjecture:
(IMPLIES (AND (NOT (NUMBERP TR+))
(LISTP LST1)
(NOT (EQUAL W 0))
(NUMBERP W)
(EQUAL (PLUS TS W) 0))
(EQUAL 0
(TS+ (CDR LST1) (PLUS TS W) TR+ W))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NUMBERP TR+)
(LISTP LST1)
(NOT (LESSP (PLUS TS W) (PLUS W TS)))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS W TS) (PLUS TS W))))
(EQUAL (TS+ (APP (CDR LST1) LST2)
(PLUS TS W)
(PLUS W TS)
W)
(TS+ (CDR LST1)
(PLUS TS W)
(PLUS W TS)
W))),
which again simplifies, rewriting with PLUS-COMMUTES1, to:
(IMPLIES (AND (NUMBERP TR+)
(LISTP LST1)
(NOT (LESSP (PLUS TS W) (PLUS TS W)))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ (APP (CDR LST1) LST2)
(PLUS TS W)
(PLUS TS W)
W)
(TS+ (CDR LST1)
(PLUS TS W)
(PLUS TS W)
W))).
Applying the lemma CAR-CDR-ELIM, replace LST1 by (CONS Z X) to eliminate
(CDR LST1) and (CAR LST1). This produces:
(IMPLIES (AND (NUMBERP TR+)
(NOT (LESSP (PLUS TS W) (PLUS TS W)))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ (APP X LST2)
(PLUS TS W)
(PLUS TS W)
W)
(TS+ X (PLUS TS W) (PLUS TS W) W))),
which we generalize by replacing (PLUS TS W) by Y. We restrict the new
variable by recalling the type restriction lemma noted when PLUS was
introduced. This produces:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP TR+)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ (APP X LST2) Y Y W)
(TS+ X Y Y W))),
which has an irrelevant term in it. By eliminating the term we get the
new goal:
(IMPLIES (AND (NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ (APP X LST2) Y Y W)
(TS+ X Y Y W))),
which we will finally name *1.1.
Perhaps we can prove it by induction. The recursive terms in the
conjecture suggest four 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 LST2 Y W))
(IMPLIES (AND (NOT (NLISTP X))
(p (CDR X) LST2 (PLUS Y W) W))
(p X LST2 Y W))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP 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. Note,
however, the inductive instance chosen for Y. The above induction scheme
leads to three new goals:
Case 3. (IMPLIES (AND (NLISTP X)
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ (APP X LST2) Y Y W)
(TS+ X Y Y W))),
which simplifies, expanding the functions NLISTP, APP, and TS+, to the goal:
(IMPLIES (AND (NOT (LISTP X))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ LST2 Y Y W) Y)).
Eliminate the irrelevant term. We would thus like to prove:
(IMPLIES (AND (NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ LST2 Y Y W) Y)),
which we will name *1.1.1.
Case 2. (IMPLIES (AND (NOT (NLISTP X))
(LESSP (PLUS Y W) (PLUS Y W))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ (APP X LST2) Y Y W)
(TS+ X Y Y W))).
This simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP X))
(EQUAL (TS+ (APP (CDR X) LST2)
(PLUS Y W)
(PLUS Y W)
W)
(TS+ (CDR X) (PLUS Y W) (PLUS Y W) W))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ (APP X LST2) Y Y W)
(TS+ X Y Y W))).
This simplifies, applying PLUS-COMMUTES1 and CDR-CONS, and opening up the
functions NLISTP, APP, and TS+, to:
(IMPLIES (AND (LISTP X)
(EQUAL (TS+ (APP (CDR X) LST2)
(PLUS W Y)
(PLUS W Y)
W)
(TS+ (CDR X) (PLUS Y W) (PLUS Y W) W))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP Y (PLUS W Y))))
(EQUAL (TS+ (APP (CDR X) LST2)
(PLUS W Y)
Y W)
(TS+ (CDR X) (PLUS W Y) Y W))).
But this again simplifies, using linear arithmetic, to:
T.
So we now return to:
(IMPLIES (AND (NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ LST2 Y Y W) Y)),
named *1.1.1 above. 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 LST2) (p LST2 Y W))
(IMPLIES (AND (NOT (NLISTP LST2))
(LESSP Y (PLUS Y W)))
(p LST2 Y W))
(IMPLIES (AND (NOT (NLISTP LST2))
(NOT (LESSP Y (PLUS Y W)))
(p (CDR LST2) (PLUS Y W) W))
(p LST2 Y W))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to show that the measure (COUNT LST2) 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 (NLISTP LST2)
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ LST2 Y Y W) Y)).
This simplifies, expanding the functions NLISTP and TS+, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP LST2))
(LESSP Y (PLUS Y W))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ LST2 Y Y W) Y)).
This simplifies, applying PLUS-COMMUTES1, and unfolding the definitions of
NLISTP and TS+, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST2))
(NOT (LESSP Y (PLUS Y W)))
(LESSP (PLUS Y W) (PLUS Y W))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ LST2 Y Y W) Y)),
which simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST2))
(NOT (LESSP Y (PLUS Y W)))
(EQUAL (TS+ (CDR LST2)
(PLUS Y W)
(PLUS Y W)
W)
(PLUS Y W))
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (TS+ LST2 Y Y W) Y)),
which simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1.1.1, which finishes the proof of *1.1,
which finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.1 ]
TS+-APP
(PROVE-LEMMA SIG-APP
(REWRITE)
(IMPLIES (AND (NOT (ENDP LST1 TS TR+ W))
(NOT (ZEROP W)))
(EQUAL (SIG (APP LST1 LST2) TS TR+ W)
(SIG LST1 TS TR+ W))))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (SIG (APP LST1 LST2) TS TR+ W)
(SIG LST1 TS TR+ W))),
which we will name *1.
Perhaps we can prove it by induction. Three 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 LST1)
(p LST1 LST2 TS TR+ W))
(IMPLIES (AND (NOT (NLISTP LST1))
(LESSP (PLUS TS W) TR+)
(p (CDR LST1) LST2 (PLUS TS W) TR+ W))
(p LST1 LST2 TS TR+ W))
(IMPLIES (AND (NOT (NLISTP LST1))
(NOT (LESSP (PLUS TS W) TR+)))
(p LST1 LST2 TS TR+ W))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT LST1) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for TS. The above induction scheme
generates the following four new formulas:
Case 4. (IMPLIES (AND (NLISTP LST1)
(NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (SIG (APP LST1 LST2) TS TR+ W)
(SIG LST1 TS TR+ W))).
This simplifies, unfolding the functions NLISTP and ENDP, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP LST1))
(LESSP (PLUS TS W) TR+)
(ENDP (CDR LST1) (PLUS TS W) TR+ W)
(NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (SIG (APP LST1 LST2) TS TR+ W)
(SIG LST1 TS TR+ W))).
This simplifies, expanding the functions NLISTP and ENDP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST1))
(LESSP (PLUS TS W) TR+)
(EQUAL (SIG (APP (CDR LST1) LST2)
(PLUS TS W)
TR+ W)
(SIG (CDR LST1) (PLUS TS W) TR+ W))
(NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (SIG (APP LST1 LST2) TS TR+ W)
(SIG LST1 TS TR+ W))).
This simplifies, applying CDR-CONS and CAR-CONS, and unfolding the functions
NLISTP, ENDP, APP, RECONCILE-SIGNALS, and SIG, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST1))
(NOT (LESSP (PLUS TS W) TR+))
(NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (SIG (APP LST1 LST2) TS TR+ W)
(SIG LST1 TS TR+ W))),
which simplifies, applying CAR-CONS, and opening up the functions NLISTP,
ENDP, APP, and SIG, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
SIG-APP
(PROVE-LEMMA ENDP-APP
(REWRITE)
(IMPLIES (AND (NOT (ENDP LST1 TS TR+ W))
(NOT (ZEROP W)))
(NOT (ENDP (APP LST1 LST2) TS TR+ W))))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (ENDP (APP LST1 LST2) TS TR+ W))),
which we will name *1.
We will appeal to 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 (NLISTP LST1)
(p LST1 LST2 TS TR+ W))
(IMPLIES (AND (NOT (NLISTP LST1))
(LESSP (PLUS TS W) TR+)
(p (CDR LST1) LST2 (PLUS TS W) TR+ W))
(p LST1 LST2 TS TR+ W))
(IMPLIES (AND (NOT (NLISTP LST1))
(NOT (LESSP (PLUS TS W) TR+)))
(p LST1 LST2 TS TR+ W))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to establish that the measure (COUNT LST1) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. Note, however, the inductive instance chosen for TS. The above
induction scheme produces four new goals:
Case 4. (IMPLIES (AND (NLISTP LST1)
(NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (ENDP (APP LST1 LST2) TS TR+ W))),
which simplifies, opening up the definitions of NLISTP and ENDP, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP LST1))
(LESSP (PLUS TS W) TR+)
(ENDP (CDR LST1) (PLUS TS W) TR+ W)
(NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (ENDP (APP LST1 LST2) TS TR+ W))),
which simplifies, unfolding NLISTP and ENDP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST1))
(LESSP (PLUS TS W) TR+)
(NOT (ENDP (APP (CDR LST1) LST2)
(PLUS TS W)
TR+ W))
(NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (ENDP (APP LST1 LST2) TS TR+ W))),
which simplifies, rewriting with the lemma CDR-CONS, and opening up the
definitions of NLISTP, ENDP, and APP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST1))
(NOT (LESSP (PLUS TS W) TR+))
(NOT (ENDP LST1 TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (ENDP (APP LST1 LST2) TS TR+ W))),
which simplifies, opening up the functions NLISTP, ENDP, and APP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
ENDP-APP
(DEFN TARGET (X) X)
Note that (EQUAL (TARGET X) X) is a theorem.
[ 0.0 0.0 0.0 ]
TARGET
(DISABLE TARGET)
[ 0.0 0.0 0.0 ]
TARGET-OFF
(PROVE-LEMMA WARP-APP
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (ZEROP W))
(NOT (ZEROP R)))
(EQUAL (TARGET (WARP (APP LST1 LST2) TS TR W R))
(APP (WARP LST1 TS TR W R)
(WARP (APP (LST* LST1 TS TR W R) LST2)
(TS* LST1 TS TR W R)
(TR* LST1 TS TR W R)
W R))))
((ENABLE TARGET WARP)))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND,
IMPLIES, and TARGET, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (WARP (APP LST1 LST2) TS TR W R)
(APP (WARP LST1 TS TR W R)
(WARP (APP (LST* LST1 TS TR W R) LST2)
(TS* LST1 TS TR W R)
(TR* LST1 TS TR W R)
W R)))),
which we will name *1.
We will appeal to induction. There are nine plausible inductions. They
merge into three likely candidate inductions, all 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 (OR (ZEROP R)
(ENDP LST1 TS (PLUS TR R) W))
(p LST1 LST2 TS TR W R))
(IMPLIES (AND (NOT (OR (ZEROP R)
(ENDP LST1 TS (PLUS TR R) W)))
(p (LST+ LST1 TS (PLUS TR R) W)
LST2
(TS+ LST1 TS (PLUS TR R) W)
(PLUS TR R)
W R))
(p LST1 LST2 TS TR W R))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, TS+-INCREASES-TR, SUB1-ADD1,
ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LST+-WEAKLY-SHORTENS-LST, and the
definitions of LISTP, ORDINALP, LESSP, ORD-LESSP, EQUAL, OR, and ZEROP can be
used to prove that the measure:
(CONS (CONS (ADD1 (COUNT LST1)) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each induction
step of the scheme. The above induction scheme produces five new conjectures:
Case 5. (IMPLIES (AND (OR (ZEROP R)
(ENDP LST1 TS (PLUS TR R) W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (WARP (APP LST1 LST2) TS TR W R)
(APP (WARP LST1 TS TR W R)
(WARP (APP (LST* LST1 TS TR W R) LST2)
(TS* LST1 TS TR W R)
(TR* LST1 TS TR W R)
W R)))),
which simplifies, rewriting with PLUS-COMMUTES1, and opening up ZEROP, OR,
WARP, LST*, TS*, TR*, LISTP, and APP, to:
T.
Case 4. (IMPLIES (AND (NOT (OR (ZEROP R)
(ENDP LST1 TS (PLUS TR R) W)))
(NOT (NUMBERP (TS+ LST1 TS (PLUS TR R) W)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (WARP (APP LST1 LST2) TS TR W R)
(APP (WARP LST1 TS TR W R)
(WARP (APP (LST* LST1 TS TR W R) LST2)
(TS* LST1 TS TR W R)
(TR* LST1 TS TR W R)
W R)))).
This simplifies, rewriting with PLUS-COMMUTES1, and unfolding the functions
ZEROP and OR, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (ZEROP R)
(ENDP LST1 TS (PLUS TR R) W)))
(LESSP (PLUS TR R)
(TS+ LST1 TS (PLUS TR R) W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (WARP (APP LST1 LST2) TS TR W R)
(APP (WARP LST1 TS TR W R)
(WARP (APP (LST* LST1 TS TR W R) LST2)
(TS* LST1 TS TR W R)
(TR* LST1 TS TR W R)
W R)))),
which simplifies, using linear arithmetic and applying NOT-LESSP-TS+, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (ZEROP R)
(ENDP LST1 TS (PLUS TR R) W)))
(NOT (LESSP (PLUS TR R)
(PLUS (TS+ LST1 TS (PLUS TR R) W) W)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (WARP (APP LST1 LST2) TS TR W R)
(APP (WARP LST1 TS TR W R)
(WARP (APP (LST* LST1 TS TR W R) LST2)
(TS* LST1 TS TR W R)
(TR* LST1 TS TR W R)
W R)))).
This simplifies, rewriting with the lemmas PLUS-COMMUTES1, CDR-CONS, and
CAR-CONS, and opening up the definitions of ZEROP, OR, WARP, LST*, TS*, TR*,
and APP, to:
(IMPLIES
(AND (NOT (ENDP LST1 TS (PLUS R TR) W))
(NOT (LESSP (PLUS R TR)
(PLUS W (TS+ LST1 TS (PLUS R TR) W))))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (WARP (APP LST1 LST2) TS TR W R)
(CONS (SIG LST1 TS (PLUS R TR) W)
(APP (WARP (LST+ LST1 TS (PLUS TR R) W)
(TS+ LST1 TS (PLUS TR R) W)
(PLUS TR R)
W R)
(WARP (APP (LST* (LST+ LST1 TS (PLUS TR R) W)
(TS+ LST1 TS (PLUS TR R) W)
(PLUS TR R)
W R)
LST2)
(TS* (LST+ LST1 TS (PLUS TR R) W)
(TS+ LST1 TS (PLUS TR R) W)
(PLUS TR R)
W R)
(TR* (LST+ LST1 TS (PLUS TR R) W)
(TS+ LST1 TS (PLUS TR R) W)
(PLUS TR R)
W R)
W R))))),
which again simplifies, using linear arithmetic and applying LESSP-TS+, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (ZEROP R)
(ENDP LST1 TS (PLUS TR R) W)))
(EQUAL (WARP (APP (LST+ LST1 TS (PLUS TR R) W)
LST2)
(TS+ LST1 TS (PLUS TR R) W)
(PLUS TR R)
W R)
(APP (WARP (LST+ LST1 TS (PLUS TR R) W)
(TS+ LST1 TS (PLUS TR R) W)
(PLUS TR R)
W R)
(WARP (APP (LST* (LST+ LST1 TS (PLUS TR R) W)
(TS+ LST1 TS (PLUS TR R) W)
(PLUS TR R)
W R)
LST2)
(TS* (LST+ LST1 TS (PLUS TR R) W)
(TS+ LST1 TS (PLUS TR R) W)
(PLUS TR R)
W R)
(TR* (LST+ LST1 TS (PLUS TR R) W)
(TS+ LST1 TS (PLUS TR R) W)
(PLUS TR R)
W R)
W R)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (WARP (APP LST1 LST2) TS TR W R)
(APP (WARP LST1 TS TR W R)
(WARP (APP (LST* LST1 TS TR W R) LST2)
(TS* LST1 TS TR W R)
(TR* LST1 TS TR W R)
W R)))).
This simplifies, appealing to the lemmas PLUS-COMMUTES1, CDR-CONS, and
CAR-CONS, and opening up the functions ZEROP, OR, WARP, LST*, TS*, TR*, and
APP, to:
(IMPLIES (AND (NOT (ENDP LST1 TS (PLUS R TR) W))
(EQUAL (WARP (APP (LST+ LST1 TS (PLUS R TR) W)
LST2)
(TS+ LST1 TS (PLUS R TR) W)
(PLUS R TR)
W R)
(APP (WARP (LST+ LST1 TS (PLUS TR R) W)
(TS+ LST1 TS (PLUS TR R) W)
(PLUS TR R)
W R)
(WARP (APP (LST* (LST+ LST1 TS (PLUS TR R) W)
(TS+ LST1 TS (PLUS TR R) W)
(PLUS TR R)
W R)
LST2)
(TS* (LST+ LST1 TS (PLUS TR R) W)
(TS+ LST1 TS (PLUS TR R) W)
(PLUS TR R)
W R)
(TR* (LST+ LST1 TS (PLUS TR R) W)
(TS+ LST1 TS (PLUS TR R) W)
(PLUS TR R)
W R)
W R)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (WARP (APP LST1 LST2) TS TR W R)
(CONS (SIG LST1 TS (PLUS R TR) W)
(WARP (APP (LST+ LST1 TS (PLUS R TR) W)
LST2)
(TS+ LST1 TS (PLUS R TR) W)
(PLUS R TR)
W R)))),
which again simplifies, appealing to the lemmas TS+-APP, LST+-APP, SIG-APP,
ENDP-APP, and PLUS-COMMUTES1, and opening up WARP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.3 0.0 ]
WARP-APP
(DEFN NLST+
(N TS TR W)
(IF (ZEROP N)
N
(IF (LESSP TR (PLUS TS W))
N
(NLST+ (SUB1 N) (PLUS TS W) TR W))))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
can be used to establish that the measure (COUNT N) decreases according to the
well-founded relation LESSP in each recursive call. Hence, NLST+ is accepted
under the principle of definition. Note that:
(OR (NUMBERP (NLST+ N TS TR W))
(EQUAL (NLST+ N TS TR W) N))
is a theorem.
[ 0.0 0.0 0.0 ]
NLST+
(PROVE-LEMMA LEN-LST+
(REWRITE)
(EQUAL (LEN (LST+ LST TS TR W))
(NLST+ (LEN LST) TS TR W)))
Give the conjecture the name *1.
We will appeal to induction. There are two plausible inductions.
However, they merge into one likely candidate induction. We will induct
according to the following scheme:
(AND (IMPLIES (NLISTP LST) (p LST TS TR W))
(IMPLIES (AND (NOT (NLISTP LST))
(LESSP TR (PLUS TS W)))
(p LST TS TR W))
(IMPLIES (AND (NOT (NLISTP LST))
(NOT (LESSP TR (PLUS TS W)))
(p (CDR LST) (PLUS TS W) TR W))
(p LST TS TR W))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP establish that the measure (COUNT LST) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for TS. The above induction scheme
produces the following three new formulas:
Case 3. (IMPLIES (NLISTP LST)
(EQUAL (LEN (LST+ LST TS TR W))
(NLST+ (LEN LST) TS TR W))).
This simplifies, opening up NLISTP, LST+, LEN, EQUAL, and NLST+, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST))
(LESSP TR (PLUS TS W)))
(EQUAL (LEN (LST+ LST TS TR W))
(NLST+ (LEN LST) TS TR W))).
This simplifies, opening up the definitions of NLISTP, LST+, LEN, and NLST+,
to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST))
(NOT (LESSP TR (PLUS TS W)))
(EQUAL (LEN (LST+ (CDR LST) (PLUS TS W) TR W))
(NLST+ (LEN (CDR LST))
(PLUS TS W)
TR W)))
(EQUAL (LEN (LST+ LST TS TR W))
(NLST+ (LEN LST) TS TR W))).
This simplifies, applying the lemma SUB1-ADD1, and opening up NLISTP, LST+,
LEN, and NLST+, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LEN-LST+
(DEFN NTS+
(N TS TR W)
(IF (ZEROP N)
TS
(IF (LESSP TR (PLUS TS W))
TS
(NTS+ (SUB1 N) (PLUS TS W) TR W))))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
can be used to establish that the measure (COUNT N) decreases according to the
well-founded relation LESSP in each recursive call. Hence, NTS+ is accepted
under the principle of definition. Note that:
(OR (NUMBERP (NTS+ N TS TR W))
(EQUAL (NTS+ N TS TR W) TS))
is a theorem.
[ 0.0 0.0 0.0 ]
NTS+
(PROVE-LEMMA LEN-TS+
(REWRITE)
(EQUAL (TS+ LST TS TR W)
(NTS+ (LEN LST) TS TR W)))
WARNING: the newly proposed lemma, LEN-TS+, could be applied whenever the
previously added lemma TS+-APP could.
Call the conjecture *1.
Perhaps we can prove it by induction. Two inductions are suggested by
terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP LST) (p LST TS TR W))
(IMPLIES (AND (NOT (NLISTP LST))
(LESSP TR (PLUS TS W)))
(p LST TS TR W))
(IMPLIES (AND (NOT (NLISTP LST))
(NOT (LESSP TR (PLUS TS W)))
(p (CDR LST) (PLUS TS W) TR W))
(p LST TS TR W))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to prove that the measure (COUNT LST) decreases according
to the well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for TS. The above induction scheme
leads to three new goals:
Case 3. (IMPLIES (NLISTP LST)
(EQUAL (TS+ LST TS TR W)
(NTS+ (LEN LST) TS TR W))),
which simplifies, opening up the definitions of NLISTP, TS+, LEN, EQUAL, and
NTS+, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST))
(LESSP TR (PLUS TS W)))
(EQUAL (TS+ LST TS TR W)
(NTS+ (LEN LST) TS TR W))),
which simplifies, expanding NLISTP, TS+, LEN, and NTS+, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST))
(NOT (LESSP TR (PLUS TS W)))
(EQUAL (TS+ (CDR LST) (PLUS TS W) TR W)
(NTS+ (LEN (CDR LST))
(PLUS TS W)
TR W)))
(EQUAL (TS+ LST TS TR W)
(NTS+ (LEN LST) TS TR W))),
which simplifies, applying the lemma SUB1-ADD1, and opening up the functions
NLISTP, TS+, LEN, and NTS+, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LEN-TS+
(DEFN NENDP
(N TS TR W)
(IF (ZEROP N)
T
(IF (LESSP (PLUS TS W) TR)
(NENDP (SUB1 N) (PLUS TS W) TR W)
F)))
Linear arithmetic, the lemma 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, NENDP is accepted under the
definitional principle. Observe that:
(OR (FALSEP (NENDP N TS TR W))
(TRUEP (NENDP N TS TR W)))
is a theorem.
[ 0.0 0.0 0.0 ]
NENDP
(PROVE-LEMMA LEN-ENDP
(REWRITE)
(EQUAL (ENDP LST TS TR W)
(NENDP (LEN LST) TS TR W)))
Call the conjecture *1.
Perhaps we can prove it by induction. Two inductions are suggested by
terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP LST) (p LST TS TR W))
(IMPLIES (AND (NOT (NLISTP LST))
(LESSP (PLUS TS W) TR)
(p (CDR LST) (PLUS TS W) TR W))
(p LST TS TR W))
(IMPLIES (AND (NOT (NLISTP LST))
(NOT (LESSP (PLUS TS W) TR)))
(p LST TS TR W))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to prove that the measure (COUNT LST) decreases according
to the well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for TS. The above induction scheme
leads to three new goals:
Case 3. (IMPLIES (NLISTP LST)
(EQUAL (ENDP LST TS TR W)
(NENDP (LEN LST) TS TR W))),
which simplifies, opening up the definitions of NLISTP, ENDP, LEN, EQUAL,
and NENDP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST))
(LESSP (PLUS TS W) TR)
(EQUAL (ENDP (CDR LST) (PLUS TS W) TR W)
(NENDP (LEN (CDR LST))
(PLUS TS W)
TR W)))
(EQUAL (ENDP LST TS TR W)
(NENDP (LEN LST) TS TR W))),
which simplifies, applying SUB1-ADD1, and unfolding NLISTP, ENDP, LEN, and
NENDP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST))
(NOT (LESSP (PLUS TS W) TR)))
(EQUAL (ENDP LST TS TR W)
(NENDP (LEN LST) TS TR W))).
This simplifies, expanding the functions NLISTP, ENDP, LEN, NENDP, and EQUAL,
to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LEN-ENDP
(PROVE-LEMMA LESSP-NLST+
(REWRITE)
(NOT (LESSP N (NLST+ N TS TR W))))
WARNING: Note that the proposed lemma LESSP-NLST+ is to be stored as zero
type prescription rules, zero compound recognizer rules, one linear rule, and
zero replacement rules.
Call the conjecture *1.
We will try to 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 (NLST+ N TS TR W) 0)
(NOT (NUMBERP (NLST+ N TS TR W))))
(p N TS TR W))
(IMPLIES (AND (NOT (OR (EQUAL (NLST+ N TS TR W) 0)
(NOT (NUMBERP (NLST+ N TS TR W)))))
(OR (EQUAL N 0) (NOT (NUMBERP N))))
(p N TS TR W))
(IMPLIES (AND (NOT (OR (EQUAL (NLST+ N TS TR W) 0)
(NOT (NUMBERP (NLST+ N TS TR W)))))
(NOT (OR (EQUAL N 0) (NOT (NUMBERP N))))
(p (SUB1 N) (PLUS TS W) TR W))
(p N TS TR W))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT can be used to establish that the measure (COUNT N) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. Note, however, the inductive instance chosen for TS. The above
induction scheme generates the following three new formulas:
Case 3. (IMPLIES (OR (EQUAL (NLST+ N TS TR W) 0)
(NOT (NUMBERP (NLST+ N TS TR W))))
(NOT (LESSP N (NLST+ N TS TR W)))).
This simplifies, expanding the definitions of NLST+, NOT, OR, EQUAL, and
LESSP, to the following three new conjectures:
Case 3.3.
(IMPLIES (AND (NOT (LESSP TR (PLUS TS W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR W)
0)
(EQUAL N 0))
(NOT (LESSP N 0))).
But this again simplifies, using linear arithmetic, to:
T.
Case 3.2.
(IMPLIES (AND (NOT (LESSP TR (PLUS TS W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR W)
0)
(NUMBERP N))
(NOT (LESSP N 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (LESSP TR (PLUS TS W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR W)
0)
(NOT (EQUAL N 0))
(NOT (NUMBERP N)))
(NOT (LESSP N N))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL (NLST+ N TS TR W) 0)
(NOT (NUMBERP (NLST+ N TS TR W)))))
(OR (EQUAL N 0) (NOT (NUMBERP N))))
(NOT (LESSP N (NLST+ N TS TR W)))),
which simplifies, expanding NLST+, NOT, and OR, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL (NLST+ N TS TR W) 0)
(NOT (NUMBERP (NLST+ N TS TR W)))))
(NOT (OR (EQUAL N 0) (NOT (NUMBERP N))))
(NOT (LESSP (SUB1 N)
(NLST+ (SUB1 N) (PLUS TS W) TR W))))
(NOT (LESSP N (NLST+ N TS TR W)))),
which simplifies, opening up the functions NLST+, NOT, OR, and LESSP, to
three new conjectures:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR W)
0))
(NOT (LESSP (SUB1 N)
(NLST+ (SUB1 N) (PLUS TS W) TR W)))
(NOT (LESSP TR (PLUS TS W))))
(NOT (LESSP N
(NLST+ (SUB1 N) (PLUS TS W) TR W)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR W)
0))
(NOT (LESSP (SUB1 N)
(NLST+ (SUB1 N) (PLUS TS W) TR W)))
(LESSP TR (PLUS TS W)))
(NOT (LESSP N N))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP TR (PLUS TS W))
(NOT (LESSP (SUB1 N)
(NLST+ (SUB1 N) (PLUS TS W) TR W))))
(NOT (LESSP (SUB1 N) (SUB1 N)))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-NLST+
(PROVE-LEMMA NLST+-EQUAL-N
(REWRITE)
(EQUAL (EQUAL (NLST+ N TS (PLUS R TR) W) N)
(OR (ZEROP N)
(LESSP (PLUS R TR) (PLUS TS W)))))
This formula simplifies, unfolding the functions ZEROP and OR, to four new
goals:
Case 4. (IMPLIES (NOT (EQUAL (NLST+ N TS (PLUS R TR) W) N))
(NOT (EQUAL N 0))),
which again simplifies, opening up the definitions of EQUAL and NLST+, to:
T.
Case 3. (IMPLIES (NOT (EQUAL (NLST+ N TS (PLUS R TR) W) N))
(NUMBERP N)),
which again simplifies, unfolding the function NLST+, to:
T.
Case 2. (IMPLIES (NOT (EQUAL (NLST+ N TS (PLUS R TR) W) N))
(NOT (LESSP (PLUS R TR) (PLUS TS W)))),
which again simplifies, opening up the function NLST+, to:
T.
Case 1. (IMPLIES (AND (EQUAL (NLST+ N TS (PLUS R TR) W) N)
(NOT (EQUAL N 0))
(NUMBERP N))
(EQUAL (LESSP (PLUS R TR) (PLUS TS W))
T)),
which again simplifies, trivially, to:
(IMPLIES (AND (EQUAL (NLST+ N TS (PLUS R TR) W) N)
(NOT (EQUAL N 0))
(NUMBERP N))
(LESSP (PLUS R TR) (PLUS TS W))).
We now use the above equality hypothesis by substituting:
(NLST+ N TS (PLUS R TR) W)
for N and keeping the equality hypothesis. This generates:
(IMPLIES (AND (EQUAL (NLST+ N TS (PLUS R TR) W) N)
(NOT (EQUAL (NLST+ N TS (PLUS R TR) W) 0))
(NUMBERP (NLST+ N TS (PLUS R TR) W)))
(LESSP (PLUS R TR) (PLUS TS W))).
This further simplifies, obviously, to the new formula:
(IMPLIES (AND (EQUAL (NLST+ N TS (PLUS R TR) W) N)
(NOT (EQUAL N 0))
(NUMBERP N))
(LESSP (PLUS R TR) (PLUS TS W))),
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 (NLST+ N TS (PLUS R TR) W) N)
(OR (ZEROP N)
(LESSP (PLUS R TR) (PLUS TS W)))).
We named this *1. We will try to prove it by induction. There are four
plausible inductions. They merge into three likely candidate inductions, two
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 N) (p N TS R TR W))
(IMPLIES (AND (NOT (ZEROP N))
(LESSP (PLUS R TR) (PLUS TS W)))
(p N TS R TR W))
(IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(p (SUB1 N) (PLUS TS W) R TR W))
(p N TS R TR W))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT N) decreases according to the well-founded relation
LESSP in each induction step of the scheme. Note, however, the inductive
instance chosen for TS. The above induction scheme produces three new goals:
Case 3. (IMPLIES (ZEROP N)
(EQUAL (EQUAL (NLST+ N TS (PLUS R TR) W) N)
(OR (ZEROP N)
(LESSP (PLUS R TR) (PLUS TS W))))),
which simplifies, opening up the functions ZEROP, EQUAL, NLST+, and OR, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(LESSP (PLUS R TR) (PLUS TS W)))
(EQUAL (EQUAL (NLST+ N TS (PLUS R TR) W) N)
(OR (ZEROP N)
(LESSP (PLUS R TR) (PLUS TS W))))),
which simplifies, expanding the functions ZEROP, NLST+, OR, and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(EQUAL (EQUAL (NLST+ (SUB1 N)
(PLUS TS W)
(PLUS R TR)
W)
(SUB1 N))
(OR (ZEROP (SUB1 N))
(LESSP (PLUS R TR)
(PLUS (PLUS TS W) W)))))
(EQUAL (EQUAL (NLST+ N TS (PLUS R TR) W) N)
(OR (ZEROP N)
(LESSP (PLUS R TR) (PLUS TS W))))),
which simplifies, rewriting with PLUS-ASSOCIATES, and opening up ZEROP, OR,
and NLST+, to the following three new conjectures:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(EQUAL (NLST+ (SUB1 N)
(PLUS TS W)
(PLUS R TR)
W)
(SUB1 N))
(EQUAL (LESSP (PLUS R TR) (PLUS TS W W))
T))
(NOT (EQUAL (SUB1 N) N))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(NOT (EQUAL (NLST+ (SUB1 N)
(PLUS TS W)
(PLUS R TR)
W)
(SUB1 N)))
(NOT (EQUAL (SUB1 N) 0))
(NOT (LESSP (PLUS R TR) (PLUS TS W W))))
(NOT (EQUAL (NLST+ (SUB1 N)
(PLUS TS W)
(PLUS R TR)
W)
N))),
which again simplifies, using linear arithmetic and applying LESSP-NLST+,
to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(EQUAL (NLST+ (SUB1 N)
(PLUS TS W)
(PLUS R TR)
W)
(SUB1 N))
(EQUAL (SUB1 N) 0))
(NOT (EQUAL (SUB1 N) N))).
This again simplifies, clearly, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
NLST+-EQUAL-N
(DEFN NLST*
(N TS TR W R)
(IF (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W))
N
(NLST* (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R))
((ORD-LESSP (CONS (CONS (ADD1 N) 0)
(DIFFERENCE (PLUS TS W) TR)))))
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, SUB1-ADD1,
NLST+-EQUAL-N, ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LESSP-NLST+, and
the definitions of LISTP, ORDINALP, NLST+, LESSP, ORD-LESSP, EQUAL, OR, ZEROP,
NTS+, and NENDP can be used to show that the measure:
(CONS (CONS (ADD1 N) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each recursive
call. Hence, NLST* is accepted under the principle of definition. Note that:
(OR (NUMBERP (NLST* N TS TR W R))
(EQUAL (NLST* N TS TR W R) N))
is a theorem.
[ 0.0 0.0 0.0 ]
NLST*
(PROVE-LEMMA LEN-LST*
(REWRITE)
(EQUAL (LEN (LST* LST TS TR W R))
(NLST* (LEN LST) TS TR W R)))
Name the conjecture *1.
Perhaps we can prove it by induction. Two inductions are suggested by
terms in the conjecture, 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 (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W))
(p LST TS TR W R))
(IMPLIES (AND (NOT (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W)))
(p (LST+ LST TS (PLUS TR R) W)
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R))
(p LST TS TR W R))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, TS+-INCREASES-TR, SUB1-ADD1,
ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LST+-WEAKLY-SHORTENS-LST, and the
definitions of LISTP, ORDINALP, LESSP, ORD-LESSP, EQUAL, OR, and ZEROP inform
us that the measure:
(CONS (CONS (ADD1 (COUNT LST)) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each induction
step of the scheme. The above induction scheme leads to the following two new
conjectures:
Case 2. (IMPLIES (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W))
(EQUAL (LEN (LST* LST TS TR W R))
(NLST* (LEN LST) TS TR W R))).
This simplifies, rewriting with the lemmas PLUS-COMMUTES1 and LEN-ENDP, and
opening up the definitions of ZEROP, OR, EQUAL, LST*, and NLST*, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W)))
(EQUAL (LEN (LST* (LST+ LST TS (PLUS TR R) W)
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R))
(NLST* (LEN (LST+ LST TS (PLUS TR R) W))
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R)))
(EQUAL (LEN (LST* LST TS TR W R))
(NLST* (LEN LST) TS TR W R))).
This simplifies, appealing to the lemmas PLUS-COMMUTES1, LEN-ENDP, LEN-LST+,
and LEN-TS+, and expanding ZEROP, OR, LST*, and NLST*, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LEN-LST*
(DEFN NTS*
(N TS TR W R)
(IF (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W))
TS
(NTS* (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R))
((ORD-LESSP (CONS (CONS (ADD1 N) 0)
(DIFFERENCE (PLUS TS W) TR)))))
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, SUB1-ADD1,
NLST+-EQUAL-N, ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LESSP-NLST+, and
the definitions of LISTP, ORDINALP, NLST+, LESSP, ORD-LESSP, EQUAL, OR, ZEROP,
NTS+, and NENDP can be used to show that the measure:
(CONS (CONS (ADD1 N) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each recursive
call. Hence, NTS* is accepted under the principle of definition. Note that:
(OR (NUMBERP (NTS* N TS TR W R))
(EQUAL (NTS* N TS TR W R) TS))
is a theorem.
[ 0.0 0.1 0.0 ]
NTS*
(PROVE-LEMMA LEN-TS*
(REWRITE)
(EQUAL (TS* LST TS TR W R)
(NTS* (LEN LST) TS TR W R)))
Give the conjecture the name *1.
We will appeal to induction. There are two plausible 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 (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W))
(p LST TS TR W R))
(IMPLIES (AND (NOT (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W)))
(p (LST+ LST TS (PLUS TR R) W)
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R))
(p LST TS TR W R))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, TS+-INCREASES-TR, SUB1-ADD1,
ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LST+-WEAKLY-SHORTENS-LST, and the
definitions of LISTP, ORDINALP, LESSP, ORD-LESSP, EQUAL, OR, and ZEROP
establish that the measure:
(CONS (CONS (ADD1 (COUNT LST)) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each induction
step of the scheme. The above induction scheme produces the following two new
formulas:
Case 2. (IMPLIES (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W))
(EQUAL (TS* LST TS TR W R)
(NTS* (LEN LST) TS TR W R))).
This simplifies, rewriting with the lemmas PLUS-COMMUTES1 and LEN-ENDP, and
unfolding ZEROP, OR, EQUAL, TS*, and NTS*, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W)))
(EQUAL (TS* (LST+ LST TS (PLUS TR R) W)
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R)
(NTS* (LEN (LST+ LST TS (PLUS TR R) W))
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R)))
(EQUAL (TS* LST TS TR W R)
(NTS* (LEN LST) TS TR W R))).
This simplifies, rewriting with PLUS-COMMUTES1, LEN-ENDP, LEN-LST+, and
LEN-TS+, and expanding the functions ZEROP, OR, TS*, and NTS*, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LEN-TS*
(DEFN NTR*
(N TS TR W R)
(IF (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W))
TR
(NTR* (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R))
((ORD-LESSP (CONS (CONS (ADD1 N) 0)
(DIFFERENCE (PLUS TS W) TR)))))
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, SUB1-ADD1,
NLST+-EQUAL-N, ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LESSP-NLST+, and
the definitions of LISTP, ORDINALP, NLST+, LESSP, ORD-LESSP, EQUAL, OR, ZEROP,
NTS+, and NENDP can be used to show that the measure:
(CONS (CONS (ADD1 N) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each recursive
call. Hence, NTR* is accepted under the principle of definition. Note that:
(OR (NUMBERP (NTR* N TS TR W R))
(EQUAL (NTR* N TS TR W R) TR))
is a theorem.
[ 0.0 0.1 0.0 ]
NTR*
(PROVE-LEMMA LEN-TR*
(REWRITE)
(EQUAL (TR* LST TS TR W R)
(NTR* (LEN LST) TS TR W R)))
Give the conjecture the name *1.
We will appeal to induction. There are two plausible 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 (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W))
(p LST TS TR W R))
(IMPLIES (AND (NOT (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W)))
(p (LST+ LST TS (PLUS TR R) W)
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R))
(p LST TS TR W R))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, TS+-INCREASES-TR, SUB1-ADD1,
ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LST+-WEAKLY-SHORTENS-LST, and the
definitions of LISTP, ORDINALP, LESSP, ORD-LESSP, EQUAL, OR, and ZEROP
establish that the measure:
(CONS (CONS (ADD1 (COUNT LST)) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each induction
step of the scheme. The above induction scheme produces the following two new
formulas:
Case 2. (IMPLIES (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W))
(EQUAL (TR* LST TS TR W R)
(NTR* (LEN LST) TS TR W R))).
This simplifies, rewriting with the lemmas PLUS-COMMUTES1 and LEN-ENDP, and
unfolding ZEROP, OR, EQUAL, TR*, and NTR*, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W)))
(EQUAL (TR* (LST+ LST TS (PLUS TR R) W)
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R)
(NTR* (LEN (LST+ LST TS (PLUS TR R) W))
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R)))
(EQUAL (TR* LST TS TR W R)
(NTR* (LEN LST) TS TR W R))).
This simplifies, rewriting with PLUS-COMMUTES1, LEN-ENDP, LEN-LST+, and
LEN-TS+, and expanding the functions ZEROP, OR, TR*, and NTR*, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LEN-TR*
(PROVE-LEMMA LEN-LISTN
(REWRITE)
(EQUAL (LEN (LISTN N FLG)) (FIX N))
((ENABLE LISTN)))
This simplifies, unfolding FIX, to two new formulas:
Case 2. (IMPLIES (NOT (NUMBERP N))
(EQUAL (LEN (LISTN N FLG)) 0)),
which again simplifies, unfolding LISTN, LEN, and EQUAL, to:
T.
Case 1. (IMPLIES (NUMBERP N)
(EQUAL (LEN (LISTN N FLG)) N)),
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 N) (p N FLG))
(IMPLIES (AND (NOT (ZEROP N)) (p (SUB1 N) FLG))
(p N FLG))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT N) decreases according to the well-founded relation
LESSP in each induction step of the scheme. The above induction scheme
generates the following two new goals:
Case 2. (IMPLIES (AND (ZEROP N) (NUMBERP N))
(EQUAL (LEN (LISTN N FLG)) N)).
This simplifies, opening up the definitions of ZEROP, NUMBERP, EQUAL, LISTN,
and LEN, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (LEN (LISTN (SUB1 N) FLG))
(SUB1 N))
(NUMBERP N))
(EQUAL (LEN (LISTN N FLG)) N)).
This simplifies, applying ADD1-SUB1 and CDR-CONS, and expanding ZEROP, LISTN,
and LEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LEN-LISTN
(DEFN LASTN
(N LST)
(IF (EQUAL N (LEN LST))
LST
(IF (NLISTP LST)
LST
(LASTN N (CDR LST)))))
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definitions of NLISTP and LEN establish that the measure (COUNT LST) decreases
according to the well-founded relation LESSP in each recursive call. Hence,
LASTN is accepted under the definitional principle.
[ 0.0 0.0 0.0 ]
LASTN
(DEFN TAILP
(X LST)
(IF (EQUAL X LST)
T
(IF (NLISTP LST)
F
(TAILP X (CDR LST)))))
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP can be used to establish that the measure (COUNT LST)
decreases according to the well-founded relation LESSP in each recursive call.
Hence, TAILP is accepted under the principle of definition. Note that:
(OR (FALSEP (TAILP X LST))
(TRUEP (TAILP X LST)))
is a theorem.
[ 0.0 0.0 0.0 ]
TAILP
(PROVE-LEMMA TAILP-TRANSITIVE
(REWRITE)
(IMPLIES (AND (TAILP X Y) (TAILP Y Z))
(TAILP X Z)))
WARNING: Note that TAILP-TRANSITIVE contains the free variable Y which will
be chosen by instantiating the hypothesis (TAILP X Y).
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 (EQUAL Y Z) (p X Z Y))
(IMPLIES (AND (NOT (EQUAL Y Z)) (NLISTP Z))
(p X Z Y))
(IMPLIES (AND (NOT (EQUAL Y Z))
(NOT (NLISTP Z))
(p X (CDR Z) Y))
(p X Z Y))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to prove that the measure (COUNT Z) decreases according to
the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme leads to four new goals:
Case 4. (IMPLIES (AND (EQUAL Y Z)
(TAILP X Y)
(TAILP Y Z))
(TAILP X Z)),
which simplifies, trivially, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL Y Z))
(NLISTP Z)
(TAILP X Y)
(TAILP Y Z))
(TAILP X Z)).
This simplifies, expanding the definitions of NLISTP and TAILP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL Y Z))
(NOT (NLISTP Z))
(NOT (TAILP Y (CDR Z)))
(TAILP X Y)
(TAILP Y Z))
(TAILP X Z)).
This simplifies, opening up the functions NLISTP and TAILP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL Y Z))
(NOT (NLISTP Z))
(TAILP X (CDR Z))
(TAILP X Y)
(TAILP Y Z))
(TAILP X Z)).
This simplifies, opening up NLISTP and TAILP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
TAILP-TRANSITIVE
(PROVE-LEMMA TAILP-LST+
(REWRITE)
(TAILP (LST+ LST TS TR W) LST))
Name the conjecture *1.
Let us appeal to the induction principle. Two inductions are suggested
by terms in the conjecture. However, they merge into one likely candidate
induction. We will induct according to the following scheme:
(AND (IMPLIES (EQUAL (LST+ LST TS TR W) LST)
(p LST TS TR W))
(IMPLIES (AND (NOT (EQUAL (LST+ LST TS TR W) LST))
(NLISTP LST))
(p LST TS TR W))
(IMPLIES (AND (NOT (EQUAL (LST+ LST TS TR W) LST))
(NOT (NLISTP LST))
(p (CDR LST) (PLUS TS W) TR W))
(p LST TS TR W))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT LST) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for TS. The above induction scheme
leads to three new conjectures:
Case 3. (IMPLIES (EQUAL (LST+ LST TS TR W) LST)
(TAILP (LST+ LST TS TR W) LST)),
which simplifies, expanding LST+ and TAILP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL (LST+ LST TS TR W) LST))
(NLISTP LST))
(TAILP (LST+ LST TS TR W) LST)),
which simplifies, unfolding the definitions of LST+ and NLISTP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL (LST+ LST TS TR W) LST))
(NOT (NLISTP LST))
(TAILP (LST+ (CDR LST) (PLUS TS W) TR W)
(CDR LST)))
(TAILP (LST+ LST TS TR W) LST)),
which simplifies, rewriting with TAILP-TRANSITIVE, and unfolding LST+,
NLISTP, and TAILP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
TAILP-LST+
(PROVE-LEMMA TAILP-LST*
(REWRITE)
(TAILP (LST* LST TS TR W R) LST))
Give the conjecture the name *1.
We will appeal to induction. Two inductions are suggested by terms in
the conjecture, 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 (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W))
(p LST TS TR W R))
(IMPLIES (AND (NOT (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W)))
(p (LST+ LST TS (PLUS TR R) W)
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R))
(p LST TS TR W R))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, TS+-INCREASES-TR, SUB1-ADD1,
ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LST+-WEAKLY-SHORTENS-LST, and the
definitions of LISTP, ORDINALP, LESSP, ORD-LESSP, EQUAL, OR, and ZEROP inform
us that the measure:
(CONS (CONS (ADD1 (COUNT LST)) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each induction
step of the scheme. The above induction scheme produces the following two new
conjectures:
Case 2. (IMPLIES (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W))
(TAILP (LST* LST TS TR W R) LST)).
This simplifies, applying PLUS-COMMUTES1 and LEN-ENDP, and opening up the
functions ZEROP, OR, EQUAL, LST*, and TAILP, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W)))
(TAILP (LST* (LST+ LST TS (PLUS TR R) W)
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R)
(LST+ LST TS (PLUS TR R) W)))
(TAILP (LST* LST TS TR W R) LST)),
which simplifies, rewriting with PLUS-COMMUTES1, LEN-ENDP, TAILP-LST+, and
TAILP-TRANSITIVE, and opening up ZEROP, OR, and LST*, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.1 0.0 0.0 ]
TAILP-LST*
(PROVE-LEMMA LEN-LASTN
(REWRITE)
(EQUAL (LEN (LASTN N LST))
(IF (LESSP (LEN LST) N) 0 (FIX N))))
This simplifies, unfolding the function FIX, to the following three new
formulas:
Case 3. (IMPLIES (AND (NOT (LESSP (LEN LST) N))
(NUMBERP N))
(EQUAL (LEN (LASTN N LST)) N)).
Give the above formula the name *1.
Case 2. (IMPLIES (LESSP (LEN LST) N)
(EQUAL (LEN (LASTN N LST)) 0)).
But this again simplifies, applying EQUAL-LEN-0, to:
(IMPLIES (LESSP (LEN LST) N)
(NOT (LISTP (LASTN N LST)))),
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 (LEN (LASTN N LST))
(IF (LESSP (LEN LST) N) 0 (FIX N))).
We named this *1. We will try to 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 (EQUAL N (LEN LST))
(p N LST))
(IMPLIES (AND (NOT (EQUAL N (LEN LST)))
(NLISTP LST))
(p N LST))
(IMPLIES (AND (NOT (EQUAL N (LEN LST)))
(NOT (NLISTP LST))
(p N (CDR LST)))
(p N LST))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definitions
of NLISTP and LEN inform us that the measure (COUNT LST) decreases according
to the well-founded relation LESSP in each induction step of the scheme. The
above induction scheme generates three new conjectures:
Case 3. (IMPLIES (EQUAL N (LEN LST))
(EQUAL (LEN (LASTN N LST))
(IF (LESSP (LEN LST) N) 0 (FIX N)))),
which simplifies, expanding the definitions of LEN, LASTN, and FIX, to the
goal:
(IMPLIES (AND (LISTP LST)
(LESSP (ADD1 (LEN (CDR LST)))
(ADD1 (LEN (CDR LST)))))
(EQUAL (ADD1 (LEN (CDR LST))) 0)).
But this again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL N (LEN LST)))
(NLISTP LST))
(EQUAL (LEN (LASTN N LST))
(IF (LESSP (LEN LST) N) 0 (FIX N)))),
which simplifies, opening up LEN, NLISTP, LASTN, EQUAL, LESSP, and FIX, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL N (LEN LST)))
(NOT (NLISTP LST))
(EQUAL (LEN (LASTN N (CDR LST)))
(IF (LESSP (LEN (CDR LST)) N)
0
(FIX N))))
(EQUAL (LEN (LASTN N LST))
(IF (LESSP (LEN LST) N) 0 (FIX N)))),
which simplifies, appealing to the lemma SUB1-ADD1, and opening up the
functions LEN, NLISTP, FIX, LASTN, LESSP, and EQUAL, to three new formulas:
Case 1.3.
(IMPLIES (AND (LISTP LST)
(NOT (EQUAL N (ADD1 (LEN (CDR LST)))))
(NOT (LESSP (LEN (CDR LST)) N))
(NUMBERP N)
(EQUAL (LEN (LASTN N (CDR LST))) N)
(NOT (EQUAL N 0)))
(NOT (LESSP (LEN (CDR LST)) (SUB1 N)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (LISTP LST)
(NOT (EQUAL N (ADD1 (LEN (CDR LST)))))
(LESSP (LEN (CDR LST)) N)
(EQUAL (LEN (LASTN N (CDR LST))) 0)
(NUMBERP N)
(NOT (LESSP (LEN (CDR LST)) (SUB1 N))))
(EQUAL 0 N)),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (LISTP LST)
(NOT (EQUAL N (ADD1 (LEN (CDR LST)))))
(LESSP (LEN (CDR LST)) N)
(EQUAL (LEN (LASTN N (CDR LST))) 0)
(EQUAL N 0)
(NUMBERP N))
(EQUAL 0 N)),
which again simplifies, clearly, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LEN-LASTN
(PROVE-LEMMA TAILP-IMPLIES-LASTN-LEN
(REWRITE)
(IMPLIES (TAILP X Y)
(EQUAL (LASTN (LEN X) Y) X)))
Give the conjecture the name *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 (EQUAL X Y) (p X Y))
(IMPLIES (AND (NOT (EQUAL X Y)) (NLISTP Y))
(p X Y))
(IMPLIES (AND (NOT (EQUAL X Y))
(NOT (NLISTP Y))
(p X (CDR Y)))
(p X Y))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT Y) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme generates four new goals:
Case 4. (IMPLIES (AND (EQUAL X Y) (TAILP X Y))
(EQUAL (LASTN (LEN X) Y) X)),
which simplifies, expanding TAILP and LASTN, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL X Y))
(NLISTP Y)
(TAILP X Y))
(EQUAL (LASTN (LEN X) Y) X)),
which simplifies, opening up the functions NLISTP and TAILP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL X Y))
(NOT (NLISTP Y))
(NOT (TAILP X (CDR Y)))
(TAILP X Y))
(EQUAL (LASTN (LEN X) Y) X)),
which simplifies, opening up the definitions of NLISTP and TAILP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL X Y))
(NOT (NLISTP Y))
(EQUAL (LASTN (LEN X) (CDR Y)) X)
(TAILP X Y))
(EQUAL (LASTN (LEN X) Y) X)),
which simplifies, opening up NLISTP, TAILP, LASTN, and LEN, to:
(IMPLIES (AND (NOT (EQUAL X Y))
(LISTP Y)
(EQUAL (LASTN (LEN X) (CDR Y)) X)
(TAILP X (CDR Y)))
(NOT (EQUAL (LEN X)
(ADD1 (LEN (CDR Y)))))).
Appealing to the lemma CAR-CDR-ELIM, we now replace Y by (CONS V Z) to
eliminate (CDR Y) and (CAR Y). This generates the goal:
(IMPLIES (AND (NOT (EQUAL X (CONS V Z)))
(EQUAL (LASTN (LEN X) Z) X)
(TAILP X Z))
(NOT (EQUAL (LEN X) (ADD1 (LEN Z))))).
We use the first equality hypothesis by substituting (LASTN (LEN X) Z) for X
and throwing away the equality. We would thus like to prove:
(IMPLIES (AND (NOT (EQUAL (LASTN (LEN X) Z) (CONS V Z)))
(TAILP (LASTN (LEN X) Z) Z))
(NOT (EQUAL (LEN (LASTN (LEN X) Z))
(ADD1 (LEN Z))))),
which further simplifies, rewriting with LEN-LASTN, to the following two new
conjectures:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL (LASTN (LEN X) Z) (CONS V Z)))
(TAILP (LASTN (LEN X) Z) Z)
(NOT (LESSP (LEN Z) (LEN X))))
(NOT (EQUAL (LEN X) (ADD1 (LEN Z))))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL (LASTN (LEN X) Z) (CONS V Z)))
(TAILP (LASTN (LEN X) Z) Z)
(LESSP (LEN Z) (LEN X)))
(NOT (EQUAL 0 (ADD1 (LEN Z))))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
TAILP-IMPLIES-LASTN-LEN
(PROVE-LEMMA LST*-IS-LASTN NIL
(EQUAL (LASTN (LEN (LST* LST TS TR W R)) LST)
(LST* LST TS TR W R))
((DISABLE LEN-LST*)))
This formula simplifies, applying TAILP-LST* and TAILP-IMPLIES-LASTN-LEN, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LST*-IS-LASTN
(DEFN PROPERP
(X)
(IF (NLISTP X)
(EQUAL X NIL)
(PROPERP (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, PROPERP is accepted under the principle of definition. From the
definition we can conclude that (OR (FALSEP (PROPERP X)) (TRUEP (PROPERP X)))
is a theorem.
[ 0.0 0.0 0.0 ]
PROPERP
(PROVE-LEMMA LASTN-NIL
(REWRITE)
(IMPLIES (AND (PROPERP LST)
(LESSP (LEN LST) N))
(EQUAL (LASTN N LST) NIL)))
Call the conjecture *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 (EQUAL N (LEN LST))
(p N LST))
(IMPLIES (AND (NOT (EQUAL N (LEN LST)))
(NLISTP LST))
(p N LST))
(IMPLIES (AND (NOT (EQUAL N (LEN LST)))
(NOT (NLISTP LST))
(p N (CDR LST)))
(p N LST))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definitions
of NLISTP and LEN can be used to establish that the measure (COUNT LST)
decreases according to the well-founded relation LESSP in each induction step
of the scheme. The above induction scheme generates five new formulas:
Case 5. (IMPLIES (AND (EQUAL N (LEN LST))
(PROPERP LST)
(LESSP (LEN LST) N))
(EQUAL (LASTN N LST) NIL)),
which simplifies, using linear arithmetic, to:
T.
Case 4. (IMPLIES (AND (NOT (EQUAL N (LEN LST)))
(NLISTP LST)
(PROPERP LST)
(LESSP (LEN LST) N))
(EQUAL (LASTN N LST) NIL)),
which simplifies, opening up the definitions of LEN, NLISTP, PROPERP, EQUAL,
LESSP, LISTP, and LASTN, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL N (LEN LST)))
(NOT (NLISTP LST))
(NOT (PROPERP (CDR LST)))
(PROPERP LST)
(LESSP (LEN LST) N))
(EQUAL (LASTN N LST) NIL)),
which simplifies, unfolding the definitions of LEN, NLISTP, and PROPERP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL N (LEN LST)))
(NOT (NLISTP LST))
(NOT (LESSP (LEN (CDR LST)) N))
(PROPERP LST)
(LESSP (LEN LST) N))
(EQUAL (LASTN N LST) NIL)),
which simplifies, applying SUB1-ADD1, and expanding LEN, NLISTP, PROPERP,
LESSP, and LASTN, to:
(IMPLIES (AND (LISTP LST)
(NOT (EQUAL N (ADD1 (LEN (CDR LST)))))
(NOT (LESSP (LEN (CDR LST)) N))
(PROPERP (CDR LST))
(NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (LEN (CDR LST)) (SUB1 N)))
(EQUAL (LASTN N (CDR LST)) NIL)),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL N (LEN LST)))
(NOT (NLISTP LST))
(EQUAL (LASTN N (CDR LST)) NIL)
(PROPERP LST)
(LESSP (LEN LST) N))
(EQUAL (LASTN N LST) NIL)),
which simplifies, appealing to the lemma SUB1-ADD1, and opening up the
definitions of LEN, NLISTP, PROPERP, LESSP, LASTN, and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LASTN-NIL
(PROVE-LEMMA PROPERP-LISTN
(REWRITE)
(PROPERP (LISTN N FLG))
((ENABLE LISTN)))
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 (ZEROP N) (p N FLG))
(IMPLIES (AND (NOT (ZEROP N)) (p (SUB1 N) FLG))
(p N FLG))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to show that the measure (COUNT N) 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 N)
(PROPERP (LISTN N FLG))),
which simplifies, unfolding the definitions of ZEROP, EQUAL, LISTN, and
PROPERP, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(PROPERP (LISTN (SUB1 N) FLG)))
(PROPERP (LISTN N FLG))),
which simplifies, rewriting with the lemma CDR-CONS, and expanding ZEROP,
LISTN, and PROPERP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
PROPERP-LISTN
(PROVE-LEMMA LASTN-LISTN
(REWRITE)
(IMPLIES (AND (NUMBERP N)
(NUMBERP K)
(NOT (LESSP K N)))
(EQUAL (LASTN N (LISTN K FLG))
(LISTN N FLG)))
((ENABLE LISTN)
(INDUCT (LISTN K FLG))))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to two new conjectures:
Case 2. (IMPLIES (AND (ZEROP K)
(NUMBERP N)
(NUMBERP K)
(NOT (LESSP K N)))
(EQUAL (LASTN N (LISTN K FLG))
(LISTN N FLG))),
which simplifies, unfolding the definitions of ZEROP, NUMBERP, EQUAL, LESSP,
LISTN, and LASTN, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL K 0))
(NUMBERP K)
(IMPLIES (AND (NUMBERP N)
(NUMBERP (SUB1 K))
(NOT (LESSP (SUB1 K) N)))
(EQUAL (LASTN N (LISTN (SUB1 K) FLG))
(LISTN N FLG)))
(NUMBERP N)
(NOT (LESSP K N)))
(EQUAL (LASTN N (LISTN K FLG))
(LISTN N FLG))),
which simplifies, rewriting with LASTN-NIL, PROPERP-LISTN, CDR-CONS,
LEN-LISTN, and ADD1-SUB1, and expanding the definitions of NOT, AND, IMPLIES,
LISTN, LEN, and LASTN, to the following three new goals:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL K 0))
(NUMBERP K)
(LESSP (SUB1 K) N)
(NUMBERP N)
(NOT (LESSP K N))
(NOT (EQUAL N K)))
(EQUAL NIL (LISTN N FLG))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL K 0))
(NUMBERP K)
(LESSP (SUB1 K) N)
(NUMBERP N)
(NOT (LESSP K N))
(EQUAL N K))
(EQUAL (CONS FLG (LISTN (SUB1 K) FLG))
(LISTN N FLG))),
which again simplifies, expanding the functions LESSP and LISTN, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL K 0))
(NUMBERP K)
(EQUAL (LASTN N (LISTN (SUB1 K) FLG))
(LISTN N FLG))
(NUMBERP N)
(NOT (LESSP K N))
(EQUAL N K))
(EQUAL (CONS FLG (LISTN (SUB1 K) FLG))
(LISTN N FLG))),
which again simplifies, using linear arithmetic, appealing to the lemmas
LEN-LISTN, PROPERP-LISTN, and LASTN-NIL, and expanding the function LISTN,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LASTN-LISTN
(PROVE-LEMMA LESSP-NLST*
(REWRITE)
(NOT (LESSP N (NLST* N TS TR W R))))
WARNING: Note that the proposed lemma LESSP-NLST* is to be stored as zero
type prescription rules, zero compound recognizer rules, one linear rule, and
zero replacement rules.
Name the conjecture *1.
Perhaps we can prove it by induction. There are two plausible 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 (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W))
(p N TS TR W R))
(IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W)))
(p (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R))
(p N TS TR W R))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, SUB1-ADD1, NLST+-EQUAL-N,
ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LESSP-NLST+, and the definitions
of LISTP, ORDINALP, NLST+, LESSP, ORD-LESSP, EQUAL, OR, ZEROP, NTS+, and NENDP
establish that the measure:
(CONS (CONS (ADD1 N) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each induction
step of the scheme. The above induction scheme produces the following two new
goals:
Case 2. (IMPLIES (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W))
(NOT (LESSP N (NLST* N TS TR W R)))).
This simplifies, applying PLUS-COMMUTES1, and unfolding the definitions of
ZEROP, OR, EQUAL, and NLST*, to three new formulas:
Case 2.3.
(IMPLIES (EQUAL R 0)
(NOT (LESSP N N))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.2.
(IMPLIES (NOT (NUMBERP R))
(NOT (LESSP N N))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (NENDP N TS (PLUS R TR) W)
(NOT (LESSP N N))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W)))
(NOT (LESSP (NLST+ N TS (PLUS TR R) W)
(NLST* (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R))))
(NOT (LESSP N (NLST* N TS TR W R)))),
which simplifies, rewriting with the lemma PLUS-COMMUTES1, and unfolding
ZEROP, OR, and NLST*, to:
(IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS R TR) W))
(NOT (LESSP (NLST+ N TS (PLUS R TR) W)
(NLST* (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R))))
(NOT (LESSP N
(NLST* (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R)))).
But this again simplifies, using linear arithmetic and rewriting with
LESSP-NLST+, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-NLST*
(PROVE-LEMMA LST*-LISTN
(REWRITE)
(IMPLIES (NUMBERP N)
(EQUAL (LST* (LISTN N FLG) TS TR W R)
(LISTN (NLST* N TS TR W R) FLG)))
((USE (LST*-IS-LASTN (LST (LISTN N FLG))))))
This formula can be simplified, using the abbreviations IMPLIES and LEN-LST*,
to:
(IMPLIES (AND (EQUAL (LASTN (NLST* (LEN (LISTN N FLG)) TS TR W R)
(LISTN N FLG))
(LST* (LISTN N FLG) TS TR W R))
(NUMBERP N))
(EQUAL (LST* (LISTN N FLG) TS TR W R)
(LISTN (NLST* N TS TR W R) FLG))),
which simplifies, using linear arithmetic and rewriting with LEN-LISTN,
LESSP-NLST*, and LASTN-LISTN, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LST*-LISTN
(DEFN N*
(N TS TR W R)
(IF (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W))
0
(ADD1 (N* (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R)))
((ORD-LESSP (CONS (CONS (ADD1 N) 0)
(DIFFERENCE (PLUS TS W) TR)))))
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, SUB1-ADD1,
NLST+-EQUAL-N, ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LESSP-NLST+, and
the definitions of LISTP, ORDINALP, NLST+, LESSP, ORD-LESSP, EQUAL, OR, ZEROP,
NTS+, and NENDP establish that the measure:
(CONS (CONS (ADD1 N) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each recursive
call. Hence, N* is accepted under the definitional principle. Observe that:
(NUMBERP (N* N TS TR W R))
is a theorem.
[ 0.0 0.1 0.0 ]
N*
(PROVE-LEMMA NOT-LESSP-NTS+
(REWRITE)
(IMPLIES (AND (NOT (LESSP TR TS))
(NOT (ZEROP W)))
(NOT (LESSP TR (NTS+ N TS TR W)))))
WARNING: Note that the proposed lemma NOT-LESSP-NTS+ is to be stored as zero
type prescription rules, zero compound recognizer rules, one linear rule, and
zero replacement rules.
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to the new formula:
(IMPLIES (AND (NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (LESSP TR (NTS+ N TS TR W)))),
which we will 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 (ZEROP N) (p TR N TS W))
(IMPLIES (AND (NOT (ZEROP N))
(LESSP TR (PLUS TS W)))
(p TR N TS W))
(IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP TR (PLUS TS W)))
(p TR (SUB1 N) (PLUS TS W) W))
(p TR N TS W))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT N) decreases according to the well-founded relation
LESSP in each induction step of the scheme. Note, however, the inductive
instance chosen for TS. The above induction scheme leads to the following
three new formulas:
Case 3. (IMPLIES (AND (ZEROP N)
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (LESSP TR (NTS+ N TS TR W)))).
This simplifies, unfolding the functions ZEROP, EQUAL, and NTS+, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(LESSP TR (PLUS TS W))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (LESSP TR (NTS+ N TS TR W)))).
This simplifies, unfolding the definitions of ZEROP and NTS+, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP TR (PLUS TS W)))
(NOT (LESSP TR
(NTS+ (SUB1 N) (PLUS TS W) TR W)))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (LESSP TR (NTS+ N TS TR W)))).
This simplifies, unfolding the definitions of ZEROP and NTS+, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
NOT-LESSP-NTS+
(PROVE-LEMMA LESSP-NTS+
(REWRITE)
(IMPLIES (AND (NOT (NENDP N TS TR W))
(NOT (LESSP TR TS))
(NOT (ZEROP W)))
(LESSP TR (PLUS W (NTS+ N TS TR W)))))
WARNING: Note that the proposed lemma LESSP-NTS+ is to be stored as zero type
prescription rules, zero compound recognizer rules, one linear rule, and zero
replacement rules.
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to the formula:
(IMPLIES (AND (NOT (NENDP N TS TR W))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP TR (PLUS W (NTS+ N TS TR W)))).
Call the above conjecture *1.
Perhaps we can prove it by induction. There are six plausible inductions.
They merge into three likely candidate inductions. However, only one is
unflawed. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP N) (p TR W N TS))
(IMPLIES (AND (NOT (ZEROP N))
(LESSP (PLUS TS W) TR)
(p TR W (SUB1 N) (PLUS TS W)))
(p TR W N TS))
(IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP (PLUS TS W) TR)))
(p TR W N TS))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT N) decreases according to the well-founded relation
LESSP in each induction step of the scheme. Note, however, the inductive
instance chosen for TS. The above induction scheme leads to the following
five new goals:
Case 5. (IMPLIES (AND (ZEROP N)
(NOT (NENDP N TS TR W))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP TR (PLUS W (NTS+ N TS TR W)))).
This simplifies, opening up ZEROP, EQUAL, and NENDP, to:
T.
Case 4. (IMPLIES (AND (NOT (ZEROP N))
(LESSP (PLUS TS W) TR)
(NENDP (SUB1 N) (PLUS TS W) TR W)
(NOT (NENDP N TS TR W))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP TR (PLUS W (NTS+ N TS TR W)))).
This simplifies, expanding ZEROP and NENDP, to:
T.
Case 3. (IMPLIES (AND (NOT (ZEROP N))
(LESSP (PLUS TS W) TR)
(LESSP TR (PLUS TS W))
(NOT (NENDP N TS TR W))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP TR (PLUS W (NTS+ N TS TR W)))).
This simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(LESSP (PLUS TS W) TR)
(LESSP TR
(PLUS W
(NTS+ (SUB1 N) (PLUS TS W) TR W)))
(NOT (NENDP N TS TR W))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP TR (PLUS W (NTS+ N TS TR W)))).
This simplifies, expanding the functions ZEROP, NENDP, and NTS+, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (PLUS TS W) TR)
(LESSP TR
(PLUS W
(NTS+ (SUB1 N) (PLUS TS W) TR W)))
(NOT (NENDP (SUB1 N) (PLUS TS W) TR W))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TR (PLUS TS W)))
(LESSP TR (PLUS W TS))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP (PLUS TS W) TR))
(NOT (NENDP N TS TR W))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP TR (PLUS W (NTS+ N TS TR W)))),
which simplifies, expanding the functions ZEROP, NENDP, and NTS+, to two new
conjectures:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (PLUS TS W) TR))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR (PLUS TS W))))
(LESSP TR
(PLUS W
(NTS+ (SUB1 N) (PLUS TS W) TR W)))),
which again simplifies, using linear arithmetic, to two new formulas:
Case 1.2.2.
(IMPLIES (AND (NOT (NUMBERP TR))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (PLUS TS W) TR))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR (PLUS TS W))))
(LESSP TR
(PLUS W
(NTS+ (SUB1 N) (PLUS TS W) TR W)))),
which again simplifies, unfolding the definitions of LESSP, EQUAL, and
PLUS, to:
T.
Case 1.2.1.
(IMPLIES (AND (NUMBERP TR)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (PLUS TS W) (PLUS W TS)))
(NOT (LESSP (PLUS W TS) TS))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS W TS) (PLUS TS W))))
(LESSP (PLUS W TS)
(PLUS W
(NTS+ (SUB1 N)
(PLUS TS W)
(PLUS W TS)
W)))),
which again simplifies, rewriting with PLUS-COMMUTES1, to:
(IMPLIES (AND (NUMBERP TR)
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (PLUS TS W) (PLUS TS W)))
(NOT (LESSP (PLUS TS W) TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP (PLUS TS W)
(PLUS W
(NTS+ (SUB1 N)
(PLUS TS W)
(PLUS TS W)
W)))).
Applying the lemma SUB1-ELIM, replace N by (ADD1 X) to eliminate
(SUB1 N). We use the type restriction lemma noted when SUB1 was
introduced to restrict the new variable. This produces:
(IMPLIES (AND (NUMBERP X)
(NUMBERP TR)
(NOT (EQUAL (ADD1 X) 0))
(NOT (LESSP (PLUS TS W) (PLUS TS W)))
(NOT (LESSP (PLUS TS W) TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP (PLUS TS W)
(PLUS W
(NTS+ X (PLUS TS W) (PLUS TS W) W)))),
which further simplifies, obviously, to the new goal:
(IMPLIES (AND (NUMBERP X)
(NUMBERP TR)
(NOT (LESSP (PLUS TS W) (PLUS TS W)))
(NOT (LESSP (PLUS TS W) TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP (PLUS TS W)
(PLUS W
(NTS+ X (PLUS TS W) (PLUS TS W) W)))),
which we generalize by replacing (PLUS TS W) by Y. We restrict the new
variable by recalling the type restriction lemma noted when PLUS was
introduced. We would thus like to prove the new conjecture:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP X)
(NUMBERP TR)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W (NTS+ X Y Y W)))),
which has an irrelevant term in it. By eliminating the term we get the
new conjecture:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP X)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W (NTS+ X Y Y W)))),
which we will finally name *1.1.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (PLUS TS W) TR))
(NOT (LESSP TR TS))
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TR (PLUS TS W)))
(LESSP TR (PLUS W TS))).
But this again simplifies, using linear arithmetic, to:
T.
So let us turn our attention to:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP X)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W (NTS+ X Y Y W)))),
named *1.1 above. We will try to prove it by induction. Seven inductions are
suggested by terms in the conjecture. They merge into three likely candidate
inductions. However, only one is unflawed. We will induct according to the
following scheme:
(AND (IMPLIES (ZEROP X) (p Y W X TS))
(IMPLIES (AND (NOT (ZEROP X))
(LESSP Y (PLUS Y W)))
(p Y W X TS))
(IMPLIES (AND (NOT (ZEROP X))
(NOT (LESSP Y (PLUS Y W)))
(p (PLUS Y W) W (SUB1 X) TS))
(p Y W X TS))).
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. Note,
however, the inductive instance chosen for Y. The above induction scheme
generates the following five new conjectures:
Case 5. (IMPLIES (AND (ZEROP X)
(NUMBERP Y)
(NUMBERP X)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W (NTS+ X Y Y W)))).
This simplifies, expanding ZEROP, NUMBERP, EQUAL, and NTS+, to:
(IMPLIES (AND (EQUAL X 0)
(NUMBERP Y)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W Y))),
which again simplifies, using linear arithmetic, to:
T.
Case 4. (IMPLIES (AND (NOT (ZEROP X))
(LESSP Y (PLUS Y W))
(NUMBERP Y)
(NUMBERP X)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W (NTS+ X Y Y W)))),
which simplifies, rewriting with PLUS-COMMUTES1, and opening up the
functions ZEROP and NTS+, to:
T.
Case 3. (IMPLIES (AND (NOT (ZEROP X))
(NOT (LESSP Y (PLUS Y W)))
(LESSP (PLUS Y W) (PLUS Y W))
(NUMBERP Y)
(NUMBERP X)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W (NTS+ X Y Y W)))).
This simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP X))
(NOT (LESSP Y (PLUS Y W)))
(LESSP (PLUS Y W) TS)
(NUMBERP Y)
(NUMBERP X)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W (NTS+ X Y Y W)))).
This simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(NOT (LESSP Y (PLUS Y W)))
(LESSP (PLUS Y W)
(PLUS W
(NTS+ (SUB1 X)
(PLUS Y W)
(PLUS Y W)
W)))
(NUMBERP Y)
(NUMBERP X)
(NOT (LESSP Y Y))
(NOT (LESSP Y TS))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP Y (PLUS W (NTS+ X Y Y W)))).
This simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1.1, which also finishes the proof of *1.
Q.E.D.
[ 0.0 0.1 0.0 ]
LESSP-NTS+
(PROVE-LEMMA LST+-LISTN
(REWRITE)
(IMPLIES (AND (NUMBERP N)
(NOT (NENDP N TS TR+ W))
(NOT (ZEROP W)))
(EQUAL (LST+ (LISTN N FLG) TS TR+ W)
(LISTN (NLST+ N TS TR+ W) FLG)))
((ENABLE LISTN)))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (NUMBERP N)
(NOT (NENDP N TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (LISTN N FLG) TS TR+ W)
(LISTN (NLST+ N TS TR+ W) FLG))),
which we will name *1.
Perhaps we can prove it by induction. Three 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 N) (p N FLG TS TR+ W))
(IMPLIES (AND (NOT (ZEROP N))
(LESSP (PLUS TS W) TR+)
(p (SUB1 N) FLG (PLUS TS W) TR+ W))
(p N FLG TS TR+ W))
(IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP (PLUS TS W) TR+)))
(p N FLG TS TR+ W))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT N) decreases according to the well-founded
relation LESSP in each induction step of the scheme. Note, however, the
inductive instance chosen for TS. The above induction scheme leads to the
following four new conjectures:
Case 4. (IMPLIES (AND (ZEROP N)
(NUMBERP N)
(NOT (NENDP N TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (LISTN N FLG) TS TR+ W)
(LISTN (NLST+ N TS TR+ W) FLG))).
This simplifies, opening up ZEROP, NUMBERP, EQUAL, and NENDP, to:
T.
Case 3. (IMPLIES (AND (NOT (ZEROP N))
(LESSP (PLUS TS W) TR+)
(NENDP (SUB1 N) (PLUS TS W) TR+ W)
(NUMBERP N)
(NOT (NENDP N TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (LISTN N FLG) TS TR+ W)
(LISTN (NLST+ N TS TR+ W) FLG))).
This simplifies, expanding ZEROP and NENDP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(LESSP (PLUS TS W) TR+)
(EQUAL (LST+ (LISTN (SUB1 N) FLG)
(PLUS TS W)
TR+ W)
(LISTN (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
FLG))
(NUMBERP N)
(NOT (NENDP N TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (LISTN N FLG) TS TR+ W)
(LISTN (NLST+ N TS TR+ W) FLG))).
This simplifies, appealing to the lemma CDR-CONS, and expanding the
functions ZEROP, NENDP, LISTN, LST+, and NLST+, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(LESSP (PLUS TS W) TR+)
(EQUAL (LST+ (LISTN (SUB1 N) FLG)
(PLUS TS W)
TR+ W)
(LISTN (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
FLG))
(NUMBERP N)
(NOT (NENDP (SUB1 N) (PLUS TS W) TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TR+ (PLUS TS W)))
(EQUAL (CONS FLG (LISTN (SUB1 N) FLG))
(LISTN N FLG))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP (PLUS TS W) TR+))
(NUMBERP N)
(NOT (NENDP N TS TR+ W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (LISTN N FLG) TS TR+ W)
(LISTN (NLST+ N TS TR+ W) FLG))),
which simplifies, applying CDR-CONS, and opening up ZEROP, NENDP, LISTN,
LST+, and NLST+, to the following two new goals:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NOT (LESSP (PLUS TS W) TR+))
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR+ (PLUS TS W))))
(EQUAL (LST+ (LISTN (SUB1 N) FLG)
(PLUS TS W)
TR+ W)
(LISTN (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
FLG))).
But this again simplifies, using linear arithmetic, to two new conjectures:
Case 1.2.2.
(IMPLIES (AND (NOT (NUMBERP TR+))
(NOT (EQUAL N 0))
(NOT (LESSP (PLUS TS W) TR+))
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR+ (PLUS TS W))))
(EQUAL (LST+ (LISTN (SUB1 N) FLG)
(PLUS TS W)
TR+ W)
(LISTN (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
FLG))),
which again simplifies, expanding the definitions of LESSP, PLUS, EQUAL,
and LST+, to:
(IMPLIES (AND (NOT (NUMBERP TR+))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(EQUAL (PLUS TS W) 0))
(EQUAL (LISTN (SUB1 N) FLG)
(LISTN (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
FLG))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.2.1.
(IMPLIES (AND (NUMBERP TR+)
(NOT (EQUAL N 0))
(NOT (LESSP (PLUS TS W) (PLUS W TS)))
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS W TS) (PLUS TS W))))
(EQUAL (LST+ (LISTN (SUB1 N) FLG)
(PLUS TS W)
(PLUS W TS)
W)
(LISTN (NLST+ (SUB1 N)
(PLUS TS W)
(PLUS W TS)
W)
FLG))),
which again simplifies, rewriting with PLUS-COMMUTES1, to:
(IMPLIES (AND (NUMBERP TR+)
(NOT (EQUAL N 0))
(NOT (LESSP (PLUS TS W) (PLUS TS W)))
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (LISTN (SUB1 N) FLG)
(PLUS TS W)
(PLUS TS W)
W)
(LISTN (NLST+ (SUB1 N)
(PLUS TS W)
(PLUS TS W)
W)
FLG))).
Applying the lemma SUB1-ELIM, replace N by (ADD1 X) to eliminate
(SUB1 N). We rely upon the type restriction lemma noted when SUB1 was
introduced to restrict the new variable. This produces the new goal:
(IMPLIES (AND (NUMBERP X)
(NUMBERP TR+)
(NOT (EQUAL (ADD1 X) 0))
(NOT (LESSP (PLUS TS W) (PLUS TS W)))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (LISTN X FLG)
(PLUS TS W)
(PLUS TS W)
W)
(LISTN (NLST+ X (PLUS TS W) (PLUS TS W) W)
FLG))),
which further simplifies, trivially, to the new formula:
(IMPLIES (AND (NUMBERP X)
(NUMBERP TR+)
(NOT (LESSP (PLUS TS W) (PLUS TS W)))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (LISTN X FLG)
(PLUS TS W)
(PLUS TS W)
W)
(LISTN (NLST+ X (PLUS TS W) (PLUS TS W) W)
FLG))),
which we generalize by replacing (PLUS TS W) by Y. We restrict the new
variable by recalling the type restriction lemma noted when PLUS was
introduced. We thus obtain:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP X)
(NUMBERP TR+)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (LISTN X FLG) Y Y W)
(LISTN (NLST+ X Y Y W) FLG))),
which has an irrelevant term in it. By eliminating the term we get:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP X)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (LISTN X FLG) Y Y W)
(LISTN (NLST+ X Y Y W) FLG))),
which we will finally name *1.1.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NOT (LESSP (PLUS TS W) TR+))
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TR+ (PLUS TS W)))
(EQUAL (CONS FLG (LISTN (SUB1 N) FLG))
(LISTN N FLG))).
This again simplifies, expanding LISTN, to:
T.
So we now return to:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP X)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (LISTN X FLG) Y Y W)
(LISTN (NLST+ X Y Y W) FLG))),
which we named *1.1 above. Let us appeal to the induction principle. 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 FLG Y W))
(IMPLIES (AND (NOT (ZEROP X))
(p (SUB1 X) FLG (PLUS Y W) W))
(p X FLG Y W))).
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 three new goals:
Case 3. (IMPLIES (AND (ZEROP X)
(NUMBERP Y)
(NUMBERP X)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (LISTN X FLG) Y Y W)
(LISTN (NLST+ X Y Y W) FLG))),
which simplifies, expanding ZEROP, NUMBERP, EQUAL, LISTN, LISTP, LST+, and
NLST+, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP X))
(LESSP (PLUS Y W) (PLUS Y W))
(NUMBERP Y)
(NUMBERP X)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (LISTN X FLG) Y Y W)
(LISTN (NLST+ X Y Y W) FLG))),
which simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(EQUAL (LST+ (LISTN (SUB1 X) FLG)
(PLUS Y W)
(PLUS Y W)
W)
(LISTN (NLST+ (SUB1 X)
(PLUS Y W)
(PLUS Y W)
W)
FLG))
(NUMBERP Y)
(NUMBERP X)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (LST+ (LISTN X FLG) Y Y W)
(LISTN (NLST+ X Y Y W) FLG))),
which simplifies, rewriting with PLUS-COMMUTES1 and CDR-CONS, and unfolding
the definitions of ZEROP, LISTN, LST+, and NLST+, to the following two new
conjectures:
Case 1.2.
(IMPLIES (AND (NOT (EQUAL X 0))
(EQUAL (LST+ (LISTN (SUB1 X) FLG)
(PLUS W Y)
(PLUS W Y)
W)
(LISTN (NLST+ (SUB1 X)
(PLUS Y W)
(PLUS Y W)
W)
FLG))
(NUMBERP Y)
(NUMBERP X)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP Y (PLUS W Y))))
(EQUAL (LST+ (LISTN (SUB1 X) FLG)
(PLUS W Y)
Y W)
(LISTN (NLST+ (SUB1 X) (PLUS W Y) Y W)
FLG))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL X 0))
(EQUAL (LST+ (LISTN (SUB1 X) FLG)
(PLUS W Y)
(PLUS W Y)
W)
(LISTN (NLST+ (SUB1 X)
(PLUS Y W)
(PLUS Y W)
W)
FLG))
(NUMBERP Y)
(NUMBERP X)
(NOT (LESSP Y Y))
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP Y (PLUS W Y)))
(EQUAL (CONS FLG (LISTN (SUB1 X) FLG))
(LISTN X FLG))),
which again simplifies, opening up the function LISTN, to:
T.
That finishes the proof of *1.1, which, consequently, finishes the proof
of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
LST+-LISTN
(PROVE-LEMMA SIG-LISTN
(REWRITE)
(IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS R TR) W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (SIG (LISTN N FLG) TS (PLUS R TR) W)
FLG))
((ENABLE LISTN)))
Name the conjecture *1.
We will appeal to induction. Eight inductions are suggested by terms in
the conjecture. They merge into three likely candidate inductions, two 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 N)
(p N FLG TS R TR W))
(IMPLIES (AND (NOT (ZEROP N))
(LESSP (PLUS TS W) (PLUS R TR))
(p (SUB1 N) FLG (PLUS TS W) R TR W))
(p N FLG TS R TR W))
(IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP (PLUS TS W) (PLUS R TR))))
(p N FLG TS R TR W))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT N) decreases according to the well-founded
relation LESSP in each induction step of the scheme. Note, however, the
inductive instance chosen for TS. The above induction scheme produces the
following three new conjectures:
Case 3. (IMPLIES (AND (ZEROP N)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS R TR) W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (SIG (LISTN N FLG) TS (PLUS R TR) W)
FLG)).
This simplifies, expanding the definitions of ZEROP, EQUAL, and NENDP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(LESSP (PLUS TS W) (PLUS R TR))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS R TR) W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (SIG (LISTN N FLG) TS (PLUS R TR) W)
FLG)).
This simplifies, applying CDR-CONS and CAR-CONS, and unfolding the functions
ZEROP, NENDP, LISTN, RECONCILE-SIGNALS, and SIG, to the formula:
(IMPLIES (AND (NOT (EQUAL N 0))
(LESSP (PLUS TS W) (PLUS R TR))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP (SUB1 N)
(PLUS TS W)
(PLUS R TR)
W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL FLG
(SIG (LISTN (SUB1 N) FLG)
(PLUS TS W)
(PLUS R TR)
W))))
(EQUAL 'Q FLG)).
Appealing to the lemma SUB1-ELIM, we now replace N by (ADD1 X) to eliminate
(SUB1 N). We employ the type restriction lemma noted when SUB1 was
introduced to constrain the new variable. The result is:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (ADD1 X) 0))
(LESSP (PLUS TS W) (PLUS R TR))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP X (PLUS TS W) (PLUS R TR) W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL FLG
(SIG (LISTN X FLG)
(PLUS TS W)
(PLUS R TR)
W))))
(EQUAL 'Q FLG)).
This further simplifies, obviously, to:
(IMPLIES (AND (NUMBERP X)
(LESSP (PLUS TS W) (PLUS R TR))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP X (PLUS TS W) (PLUS R TR) W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL FLG
(SIG (LISTN X FLG)
(PLUS TS W)
(PLUS R TR)
W))))
(EQUAL 'Q FLG)),
which we generalize by replacing (PLUS R TR) by Y and (PLUS TS W) by A. We
restrict the new variables by recalling the type restriction lemma noted
when PLUS was introduced. We would thus like to prove the new conjecture:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP A)
(NUMBERP X)
(LESSP A Y)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP X A Y W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR A)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL FLG
(SIG (LISTN X FLG) A Y W))))
(EQUAL 'Q FLG)),
which has two irrelevant terms in it. By eliminating these terms we get:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP A)
(NUMBERP X)
(LESSP A Y)
(NOT (NENDP X A Y W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR A)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL FLG
(SIG (LISTN X FLG) A Y W))))
(EQUAL 'Q FLG)),
which we will finally name *1.1.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP (PLUS TS W) (PLUS R TR)))
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS R TR) W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (SIG (LISTN N FLG) TS (PLUS R TR) W)
FLG)).
This simplifies, rewriting with CAR-CONS, and opening up the definitions of
ZEROP, NENDP, LISTN, and SIG, to:
T.
So we now return to:
(IMPLIES (AND (NUMBERP Y)
(NUMBERP A)
(NUMBERP X)
(LESSP A Y)
(NOT (NENDP X A Y W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR A)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL FLG
(SIG (LISTN X FLG) A Y W))))
(EQUAL 'Q FLG)),
which we named *1.1 above. Let us appeal to the induction principle. There
are eight 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 FLG X A Y W TR TS))
(IMPLIES (AND (NOT (ZEROP X))
(LESSP (PLUS A W) Y)
(p FLG (SUB1 X) (PLUS A W) Y W TR TS))
(p FLG X A Y W TR TS))
(IMPLIES (AND (NOT (ZEROP X))
(NOT (LESSP (PLUS A W) Y)))
(p FLG X A Y W TR TS))).
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. Note,
however, the inductive instance chosen for A. The above induction scheme
generates the following five new conjectures:
Case 5. (IMPLIES (AND (ZEROP X)
(NUMBERP Y)
(NUMBERP A)
(NUMBERP X)
(LESSP A Y)
(NOT (NENDP X A Y W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR A)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL FLG
(SIG (LISTN X FLG) A Y W))))
(EQUAL 'Q FLG)).
This simplifies, unfolding the functions ZEROP, NUMBERP, EQUAL, and NENDP,
to:
T.
Case 4. (IMPLIES (AND (NOT (ZEROP X))
(LESSP (PLUS A W) Y)
(NENDP (SUB1 X) (PLUS A W) Y W)
(NUMBERP Y)
(NUMBERP A)
(NUMBERP X)
(LESSP A Y)
(NOT (NENDP X A Y W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR A)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL FLG
(SIG (LISTN X FLG) A Y W))))
(EQUAL 'Q FLG)).
This simplifies, unfolding ZEROP and NENDP, to:
T.
Case 3. (IMPLIES (AND (NOT (ZEROP X))
(LESSP (PLUS A W) Y)
(NOT (LESSP TR (PLUS A W)))
(NUMBERP Y)
(NUMBERP A)
(NUMBERP X)
(LESSP A Y)
(NOT (NENDP X A Y W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR A)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL FLG
(SIG (LISTN X FLG) A Y W))))
(EQUAL 'Q FLG)).
This simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP X))
(LESSP (PLUS A W) Y)
(EQUAL FLG
(SIG (LISTN (SUB1 X) FLG)
(PLUS A W)
Y W))
(NUMBERP Y)
(NUMBERP A)
(NUMBERP X)
(LESSP A Y)
(NOT (NENDP X A Y W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR A)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL FLG
(SIG (LISTN X FLG) A Y W))))
(EQUAL 'Q FLG)).
This simplifies, applying the lemmas CDR-CONS and CAR-CONS, and expanding
the definitions of ZEROP, NENDP, LISTN, RECONCILE-SIGNALS, and SIG, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(NOT (LESSP (PLUS A W) Y))
(NUMBERP Y)
(NUMBERP A)
(NUMBERP X)
(LESSP A Y)
(NOT (NENDP X A Y W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR A)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL FLG
(SIG (LISTN X FLG) A Y W))))
(EQUAL 'Q FLG)).
This simplifies, appealing to the lemma CAR-CONS, and opening up ZEROP,
NENDP, LISTN, and SIG, to:
T.
That finishes the proof of *1.1, which also finishes the proof of *1.
Q.E.D.
[ 0.0 0.1 0.0 ]
SIG-LISTN
(PROVE-LEMMA WARP-LISTN
(REWRITE)
(IMPLIES (AND (NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (ZEROP W))
(NOT (ZEROP R)))
(EQUAL (WARP (LISTN N FLG) TS TR W R)
(LISTN (N* N TS TR W R) FLG)))
((INDUCT (N* N TS TR W R))
(ENABLE LISTN)
(EXPAND (WARP (LISTN N FLG) TS TR W R))))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to two new goals:
Case 2. (IMPLIES (AND (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R))
(EQUAL (WARP (LISTN N FLG) TS TR W R)
(LISTN (N* N TS TR W R) FLG))),
which simplifies, applying the lemmas PLUS-COMMUTES1, LEN-LISTN, and
LEN-ENDP, and opening up the definitions of ZEROP, OR, WARP, N*, EQUAL, and
LISTN, to:
T.
Case 1. (IMPLIES
(AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS TR R) W))
(IMPLIES (AND (NUMBERP (NLST+ N TS (PLUS TR R) W))
(NUMBERP (NTS+ N TS (PLUS TR R) W))
(NUMBERP (PLUS TR R))
(NOT (LESSP (PLUS TR R)
(NTS+ N TS (PLUS TR R) W)))
(LESSP (PLUS TR R)
(PLUS (NTS+ N TS (PLUS TR R) W) W))
(NOT (ZEROP W))
(NOT (ZEROP R)))
(EQUAL (WARP (LISTN (NLST+ N TS (PLUS TR R) W) FLG)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R)
(LISTN (N* (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R)
FLG)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (WARP (LISTN N FLG) TS TR W R)
(LISTN (N* N TS TR W R) FLG))),
which simplifies, applying the lemmas PLUS-COMMUTES1, LEN-LISTN, LEN-ENDP,
SIG-LISTN, LST+-LISTN, and LEN-TS+, and opening up the functions NOT, ZEROP,
AND, IMPLIES, and WARP, to three new conjectures:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS R TR) W))
(LESSP (PLUS R TR)
(NTS+ N TS (PLUS R TR) W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (CONS FLG
(WARP (LISTN (NLST+ N TS (PLUS R TR) W) FLG)
(NTS+ N TS (PLUS R TR) W)
(PLUS R TR)
W R))
(LISTN (N* N TS TR W R) FLG))),
which again simplifies, using linear arithmetic and rewriting with
NOT-LESSP-NTS+, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS R TR) W))
(NOT (LESSP (PLUS R TR)
(PLUS W (NTS+ N TS (PLUS R TR) W))))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (CONS FLG
(WARP (LISTN (NLST+ N TS (PLUS R TR) W) FLG)
(NTS+ N TS (PLUS R TR) W)
(PLUS R TR)
W R))
(LISTN (N* N TS TR W R) FLG))).
This again simplifies, using linear arithmetic and rewriting with
LESSP-NTS+, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS R TR) W))
(EQUAL (WARP (LISTN (NLST+ N TS (PLUS R TR) W) FLG)
(NTS+ N TS (PLUS R TR) W)
(PLUS R TR)
W R)
(LISTN (N* (NLST+ N TS (PLUS R TR) W)
(NTS+ N TS (PLUS R TR) W)
(PLUS R TR)
W R)
FLG))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (CONS FLG
(LISTN (N* (NLST+ N TS (PLUS R TR) W)
(NTS+ N TS (PLUS R TR) W)
(PLUS R TR)
W R)
FLG))
(LISTN (N* N TS TR W R) FLG))).
However this again simplifies, rewriting with PLUS-COMMUTES1 and SUB1-ADD1,
and expanding N* and LISTN, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
WARP-LISTN
(PROVE-LEMMA LST+-APP-GAP
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR+)
(NENDP (LEN PAD) TS TR+ W))
(EQUAL (LST+ (APP PAD LST) TS TR+ W)
(LST+ LST
(PLUS TS (TIMES (LEN PAD) W))
TR+ W)))
((INDUCT (ENDP PAD TS TR+ W))))
This conjecture can be simplified, using the abbreviations IMPLIES, NLISTP,
NOT, OR, AND, and PLUS-ASSOCIATES, to three new goals:
Case 3. (IMPLIES (AND (NOT (LISTP PAD))
(NUMBERP TS)
(NUMBERP TR+)
(NENDP (LEN PAD) TS TR+ W))
(EQUAL (LST+ (APP PAD LST) TS TR+ W)
(LST+ LST
(PLUS TS (TIMES (LEN PAD) W))
TR+ W))),
which simplifies, applying the lemma PLUS-COMMUTES1, and unfolding the
functions LEN, EQUAL, NENDP, APP, TIMES, and PLUS, to:
T.
Case 2. (IMPLIES
(AND (LISTP PAD)
(LESSP (PLUS TS W) TR+)
(IMPLIES (AND (NUMBERP (PLUS TS W))
(NUMBERP TR+)
(NENDP (LEN (CDR PAD))
(PLUS TS W)
TR+ W))
(EQUAL (LST+ (APP (CDR PAD) LST)
(PLUS TS W)
TR+ W)
(LST+ LST
(PLUS TS W (TIMES (LEN (CDR PAD)) W))
TR+ W)))
(NUMBERP TS)
(NUMBERP TR+)
(NENDP (LEN PAD) TS TR+ W))
(EQUAL (LST+ (APP PAD LST) TS TR+ W)
(LST+ LST
(PLUS TS (TIMES (LEN PAD) W))
TR+ W))),
which simplifies, applying the lemmas TIMES-COMMUTES1, SUB1-ADD1, CDR-CONS,
and TIMES-ADD1, and unfolding the functions AND, IMPLIES, LEN, NENDP, APP,
and LST+, to the formula:
(IMPLIES (AND (LISTP PAD)
(LESSP (PLUS TS W) TR+)
(EQUAL (LST+ (APP (CDR PAD) LST)
(PLUS TS W)
TR+ W)
(LST+ LST
(PLUS TS W (TIMES W (LEN (CDR PAD))))
TR+ W))
(NUMBERP TS)
(NUMBERP TR+)
(NENDP (LEN (CDR PAD))
(PLUS TS W)
TR+ W)
(LESSP TR+ (PLUS TS W)))
(EQUAL (CONS (CAR PAD) (APP (CDR PAD) LST))
(LST+ (APP (CDR PAD) LST)
(PLUS TS W)
TR+ W))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (LISTP PAD)
(NOT (LESSP (PLUS TS W) TR+))
(NUMBERP TS)
(NUMBERP TR+)
(NENDP (LEN PAD) TS TR+ W))
(EQUAL (LST+ (APP PAD LST) TS TR+ W)
(LST+ LST
(PLUS TS (TIMES (LEN PAD) W))
TR+ W))),
which simplifies, appealing to the lemma EQUAL-LEN-0, and expanding the
function NENDP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LST+-APP-GAP
(PROVE-LEMMA NTS+-APP-GAP
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR+)
(NUMBERP K)
(NENDP K TS TR+ W))
(EQUAL (NTS+ (PLUS N K) TS TR+ W)
(NTS+ N
(PLUS TS (TIMES K W))
TR+ W))))
This formula simplifies, applying PLUS-COMMUTES1, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR+)
(NUMBERP K)
(NENDP K TS TR+ W))
(EQUAL (NTS+ (PLUS K N) TS TR+ W)
(NTS+ N
(PLUS TS (TIMES K W))
TR+ W))).
Give the above formula the name *1.
We will appeal to induction. The recursive terms in the conjecture
suggest five inductions. They merge into three likely candidate inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (ZEROP K) (p K N TS TR+ W))
(IMPLIES (AND (NOT (ZEROP K))
(LESSP (PLUS TS W) TR+)
(p (SUB1 K) N (PLUS TS W) TR+ W))
(p K N TS TR+ W))
(IMPLIES (AND (NOT (ZEROP K))
(NOT (LESSP (PLUS TS W) TR+)))
(p K N TS TR+ W))).
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. Note,
however, the inductive instance chosen for TS. The above induction scheme
generates four new goals:
Case 4. (IMPLIES (AND (ZEROP K)
(NUMBERP TS)
(NUMBERP TR+)
(NUMBERP K)
(NENDP K TS TR+ W))
(EQUAL (NTS+ (PLUS K N) TS TR+ W)
(NTS+ N
(PLUS TS (TIMES K W))
TR+ W))),
which simplifies, rewriting with the lemma PLUS-COMMUTES1, and opening up
the definitions of ZEROP, NUMBERP, EQUAL, NENDP, PLUS, and TIMES, to the
formula:
(IMPLIES (AND (EQUAL K 0)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (NUMBERP N)))
(EQUAL (NTS+ 0 TS TR+ W)
(NTS+ N TS TR+ W))).
However this again simplifies, opening up the definitions of EQUAL and NTS+,
to:
T.
Case 3. (IMPLIES (AND (NOT (ZEROP K))
(LESSP (PLUS TS W) TR+)
(NOT (NENDP (SUB1 K) (PLUS TS W) TR+ W))
(NUMBERP TS)
(NUMBERP TR+)
(NUMBERP K)
(NENDP K TS TR+ W))
(EQUAL (NTS+ (PLUS K N) TS TR+ W)
(NTS+ N
(PLUS TS (TIMES K W))
TR+ W))),
which simplifies, unfolding the functions ZEROP and NENDP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP K))
(LESSP (PLUS TS W) TR+)
(EQUAL (NTS+ (PLUS (SUB1 K) N)
(PLUS TS W)
TR+ W)
(NTS+ N
(PLUS (PLUS TS W) (TIMES (SUB1 K) W))
TR+ W))
(NUMBERP TS)
(NUMBERP TR+)
(NUMBERP K)
(NENDP K TS TR+ W))
(EQUAL (NTS+ (PLUS K N) TS TR+ W)
(NTS+ N
(PLUS TS (TIMES K W))
TR+ W))),
which simplifies, applying PLUS-ASSOCIATES and SUB1-ADD1, and opening up the
functions ZEROP, NENDP, PLUS, NTS+, and TIMES, to:
(IMPLIES (AND (NOT (EQUAL K 0))
(LESSP (PLUS TS W) TR+)
(EQUAL (NTS+ (PLUS (SUB1 K) N)
(PLUS TS W)
TR+ W)
(NTS+ N
(PLUS TS W (TIMES (SUB1 K) W))
TR+ W))
(NUMBERP TS)
(NUMBERP TR+)
(NUMBERP K)
(NENDP (SUB1 K) (PLUS TS W) TR+ W)
(LESSP TR+ (PLUS TS W)))
(EQUAL TS
(NTS+ (PLUS (SUB1 K) N)
(PLUS TS W)
TR+ W))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP K))
(NOT (LESSP (PLUS TS W) TR+))
(NUMBERP TS)
(NUMBERP TR+)
(NUMBERP K)
(NENDP K TS TR+ W))
(EQUAL (NTS+ (PLUS K N) TS TR+ W)
(NTS+ N
(PLUS TS (TIMES K W))
TR+ W))),
which simplifies, unfolding the definitions of ZEROP and NENDP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
NTS+-APP-GAP
(PROVE-LEMMA WARP-APP-GAP
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NOT (ZEROP R))
(NENDP (LEN PAD) TS (PLUS R TR) W))
(EQUAL (WARP (APP PAD LST) TS TR W R)
(IF (NENDP (PLUS (LEN PAD) (LEN LST))
TS
(PLUS R TR)
W)
NIL
(CONS (SIG (APP PAD LST) TS (PLUS R TR) W)
(WARP (LST+ LST
(PLUS TS (TIMES (LEN PAD) W))
(PLUS R TR)
W)
(NTS+ (LEN LST)
(PLUS TS (TIMES (LEN PAD) W))
(PLUS R TR)
W)
(PLUS R TR)
W R)))))
((EXPAND (WARP (APP PAD LST) TS TR W R))))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to the new conjecture:
(IMPLIES (AND (NUMBERP TS)
(NOT (EQUAL R 0))
(NUMBERP R)
(NENDP (LEN PAD) TS (PLUS R TR) W))
(EQUAL (WARP (APP PAD LST) TS TR W R)
(IF (NENDP (PLUS (LEN PAD) (LEN LST))
TS
(PLUS R TR)
W)
NIL
(CONS (SIG (APP PAD LST) TS (PLUS R TR) W)
(WARP (LST+ LST
(PLUS TS (TIMES (LEN PAD) W))
(PLUS R TR)
W)
(NTS+ (LEN LST)
(PLUS TS (TIMES (LEN PAD) W))
(PLUS R TR)
W)
(PLUS R TR)
W R))))),
which simplifies, appealing to the lemmas PLUS-COMMUTES1, LEN-APP, LEN-ENDP,
TIMES-COMMUTES1, LST+-APP-GAP, NTS+-APP-GAP, and LEN-TS+, and unfolding WARP,
to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
WARP-APP-GAP
(PROVE-LEMMA NENDP-NLST*
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP R))
(NOT (ZEROP W))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NENDP (NLST* K TS TR W R)
(NTS* K TS TR W R)
(PLUS R (NTR* K TS TR W R))
W)))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NENDP (NLST* K TS TR W R)
(NTS* K TS TR W R)
(PLUS R (NTR* K TS TR W R))
W)),
which we will name *1.
We will appeal to induction. Eight inductions are suggested by terms in
the conjecture. They merge into three likely candidate inductions, two 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 (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W))
(p K TS TR W R))
(IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(p (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R))
(p K TS TR W R))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, SUB1-ADD1, NLST+-EQUAL-N,
ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LESSP-NLST+, and the definitions
of LISTP, ORDINALP, NLST+, LESSP, ORD-LESSP, EQUAL, OR, ZEROP, NTS+, and NENDP
inform us that the measure:
(CONS (CONS (ADD1 K) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each induction
step of the scheme. The above induction scheme produces the following five
new goals:
Case 5. (IMPLIES (AND (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NENDP (NLST* K TS TR W R)
(NTS* K TS TR W R)
(PLUS R (NTR* K TS TR W R))
W)).
This simplifies, appealing to the lemma PLUS-COMMUTES1, and unfolding the
functions ZEROP, OR, NLST*, NTS*, and NTR*, to:
T.
Case 4. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(NOT (NUMBERP (NTS+ K TS (PLUS TR R) W)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NENDP (NLST* K TS TR W R)
(NTS* K TS TR W R)
(PLUS R (NTR* K TS TR W R))
W)).
This simplifies, applying PLUS-COMMUTES1, and unfolding the definitions of
ZEROP and OR, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(LESSP (PLUS TR R)
(NTS+ K TS (PLUS TR R) W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NENDP (NLST* K TS TR W R)
(NTS* K TS TR W R)
(PLUS R (NTR* K TS TR W R))
W)),
which simplifies, using linear arithmetic and rewriting with NOT-LESSP-NTS+,
to:
T.
Case 2. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(NOT (LESSP (PLUS TR R)
(PLUS (NTS+ K TS (PLUS TR R) W) W)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NENDP (NLST* K TS TR W R)
(NTS* K TS TR W R)
(PLUS R (NTR* K TS TR W R))
W)).
This simplifies, applying PLUS-COMMUTES1, and unfolding the definitions of
ZEROP, OR, NLST*, NTS*, and NTR*, to:
(IMPLIES (AND (NOT (NENDP K TS (PLUS R TR) W))
(NOT (LESSP (PLUS R TR)
(PLUS W (NTS+ K TS (PLUS R TR) W))))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NENDP (NLST* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R)
(NTS* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R)
(PLUS R
(NTR* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R))
W)).
This again simplifies, using linear arithmetic and applying LESSP-NTS+, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(NENDP (NLST* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R)
(NTS* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R)
(PLUS R
(NTR* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R))
W)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NENDP (NLST* K TS TR W R)
(NTS* K TS TR W R)
(PLUS R (NTR* K TS TR W R))
W)).
This simplifies, appealing to the lemma PLUS-COMMUTES1, and expanding the
definitions of ZEROP, OR, NLST*, NTS*, and NTR*, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
NENDP-NLST*
(DEFN NQG
(K TS TR W R)
(IF (LESSP (PLUS R TR)
(PLUS W TS (TIMES W K)))
(IF (LESSP (PLUS R R TR)
(PLUS W TS (TIMES W K)))
3 2)
1))
From the definition we can conclude that (NUMBERP (NQG K TS TR W R)) is a
theorem.
[ 0.0 0.0 0.0 ]
NQG
(DEFN DWG
(K TS TR W R)
(IF (LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(IF (LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W)))
0 1)
(IF (EQUAL (PLUS R TR)
(PLUS TS W (TIMES K W)))
0
(IF (AND (LESSP (PLUS TS W (TIMES K W))
(PLUS R TR))
(LESSP (PLUS R TR)
(PLUS TS W W (TIMES K W))))
0
(IF (LESSP (PLUS R TR)
(PLUS TS W W (TIMES K W)))
0 1)))))
Observe that (NUMBERP (DWG K TS TR W R)) is a theorem.
[ 0.0 0.0 0.0 ]
DWG
(DEFN TSG
(K TS TR W R)
(PLUS TS
(TIMES W K)
W
(TIMES W (DWG K TS TR W R))))
Note that (NUMBERP (TSG K TS TR W R)) is a theorem.
[ 0.0 0.0 0.0 ]
TSG
(DEFN TRG
(K TS TR W R)
(PLUS TR (TIMES R (NQG K TS TR W R))))
Observe that (NUMBERP (TRG K TS TR W R)) is a theorem.
[ 0.0 0.0 0.0 ]
TRG
(PROVE-LEMMA NOT-LESSP-NTR*-NTS*
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (ZEROP W)))
(NOT (LESSP (NTR* K TS TR W R)
(NTS* K TS TR W R)))))
WARNING: Note that the proposed lemma NOT-LESSP-NTR*-NTS* is to be stored as
zero type prescription rules, zero compound recognizer rules, two linear rules,
and zero replacement rules.
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (LESSP (NTR* K TS TR W R)
(NTS* K TS TR W R)))),
which we will name *1.
We will appeal to induction. There are six plausible inductions. 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 (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W))
(p K TS TR W R))
(IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(p (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R))
(p K TS TR W R))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, SUB1-ADD1, NLST+-EQUAL-N,
ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LESSP-NLST+, and the definitions
of LISTP, ORDINALP, NLST+, LESSP, ORD-LESSP, EQUAL, OR, ZEROP, NTS+, and NENDP
establish that the measure:
(CONS (CONS (ADD1 K) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each induction
step of the scheme. The above induction scheme leads to the following five
new conjectures:
Case 5. (IMPLIES (AND (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (LESSP (NTR* K TS TR W R)
(NTS* K TS TR W R)))).
This simplifies, rewriting with the lemma PLUS-COMMUTES1, and opening up
ZEROP, OR, EQUAL, NTR*, and NTS*, to:
T.
Case 4. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(NOT (NUMBERP (NTS+ K TS (PLUS TR R) W)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (LESSP (NTR* K TS TR W R)
(NTS* K TS TR W R)))).
This simplifies, rewriting with PLUS-COMMUTES1, and unfolding the functions
ZEROP and OR, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(LESSP (PLUS TR R)
(NTS+ K TS (PLUS TR R) W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (LESSP (NTR* K TS TR W R)
(NTS* K TS TR W R)))),
which simplifies, using linear arithmetic and rewriting with NOT-LESSP-NTS+,
to:
T.
Case 2. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(NOT (LESSP (PLUS TR R)
(PLUS (NTS+ K TS (PLUS TR R) W) W)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (LESSP (NTR* K TS TR W R)
(NTS* K TS TR W R)))).
This simplifies, applying PLUS-COMMUTES1, and opening up the functions ZEROP,
OR, NTR*, and NTS*, to:
(IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP K TS (PLUS R TR) W))
(NOT (LESSP (PLUS R TR)
(PLUS W (NTS+ K TS (PLUS R TR) W))))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (LESSP (NTR* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R)
(NTS* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R)))).
But this again simplifies, using linear arithmetic and rewriting with
LESSP-NTS+, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(NOT (LESSP (NTR* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R)
(NTS* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(NOT (LESSP (NTR* K TS TR W R)
(NTS* K TS TR W R)))).
This simplifies, rewriting with PLUS-COMMUTES1, and unfolding the
definitions of ZEROP, OR, NTR*, and NTS*, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
NOT-LESSP-NTR*-NTS*
(PROVE-LEMMA LESSP-NTR*-NTS*
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (ZEROP W)))
(LESSP (NTR* K TS TR W R)
(PLUS W (NTS* K TS TR W R)))))
WARNING: Note that the proposed lemma LESSP-NTR*-NTS* is to be stored as zero
type prescription rules, zero compound recognizer rules, two linear rules, and
zero replacement rules.
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP (NTR* K TS TR W R)
(PLUS W (NTS* K TS TR W R)))).
Call the above conjecture *1.
We will appeal to induction. Seven inductions are suggested by terms in
the conjecture. They merge into three likely candidate inductions, two 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 (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W))
(p K TS TR W R))
(IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(p (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R))
(p K TS TR W R))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, SUB1-ADD1, NLST+-EQUAL-N,
ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LESSP-NLST+, and the definitions
of LISTP, ORDINALP, NLST+, LESSP, ORD-LESSP, EQUAL, OR, ZEROP, NTS+, and NENDP
can be used to show that the measure:
(CONS (CONS (ADD1 K) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each induction
step of the scheme. The above induction scheme produces five new formulas:
Case 5. (IMPLIES (AND (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP (NTR* K TS TR W R)
(PLUS W (NTS* K TS TR W R)))),
which simplifies, applying PLUS-COMMUTES1, and opening up the definitions of
ZEROP, OR, EQUAL, NTR*, and NTS*, to:
T.
Case 4. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(NOT (NUMBERP (NTS+ K TS (PLUS TR R) W)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP (NTR* K TS TR W R)
(PLUS W (NTS* K TS TR W R)))).
This simplifies, applying PLUS-COMMUTES1, and opening up ZEROP and OR, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(LESSP (PLUS TR R)
(NTS+ K TS (PLUS TR R) W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP (NTR* K TS TR W R)
(PLUS W (NTS* K TS TR W R)))),
which simplifies, using linear arithmetic and applying NOT-LESSP-NTS+, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(NOT (LESSP (PLUS TR R)
(PLUS (NTS+ K TS (PLUS TR R) W) W)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP (NTR* K TS TR W R)
(PLUS W (NTS* K TS TR W R)))).
This simplifies, applying PLUS-COMMUTES1, and unfolding ZEROP, OR, NTR*, and
NTS*, to the conjecture:
(IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP K TS (PLUS R TR) W))
(NOT (LESSP (PLUS R TR)
(PLUS W (NTS+ K TS (PLUS R TR) W))))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP (NTR* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R)
(PLUS W
(NTS* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R)))).
This again simplifies, using linear arithmetic and applying LESSP-NTS+, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(LESSP (NTR* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R)
(PLUS W
(NTS* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (EQUAL W 0))
(NUMBERP W))
(LESSP (NTR* K TS TR W R)
(PLUS W (NTS* K TS TR W R)))).
This simplifies, rewriting with PLUS-COMMUTES1, and expanding the
definitions of ZEROP, OR, NTR*, and NTS*, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.2 0.0 ]
LESSP-NTR*-NTS*
(PROVE-LEMMA NENDP-IS-USUALLY-F
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP 2 K))
(NOT (NENDP K TS (PLUS R TR) W)))
((EXPAND (NENDP K TS (PLUS R TR) W)
(NENDP (SUB1 K)
(PLUS TS W)
(PLUS R TR)
W)
(NENDP (SUB1 (SUB1 K))
(PLUS TS W W)
(PLUS R TR)
W))))
This conjecture simplifies, applying the lemma PLUS-ASSOCIATES, and expanding
the function NENDP, to the following five new conjectures:
Case 5. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP 2 K))
(NOT (EQUAL K 0))).
But this again simplifies, using linear arithmetic, to:
T.
Case 4. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP 2 K))
(NUMBERP K)),
which again simplifies, opening up the definition of LESSP, to:
T.
Case 3. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP 2 K)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR)))
(NOT (EQUAL (SUB1 (SUB1 K)) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP 2 K)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(LESSP (PLUS TS W W W) (PLUS R TR)))
(NOT (NENDP (SUB1 (SUB1 (SUB1 K)))
(PLUS TS W W W)
(PLUS R TR)
W))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP 2 K)
(LESSP (PLUS TS W) (PLUS R TR)))
(NOT (EQUAL (SUB1 K) 0))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NENDP-IS-USUALLY-F
(PROVE-LEMMA LESSP-PLUS-NTS*-TIMES-W-NLST*-PLUS-R-NTR*-LEMMA
(REWRITE)
(IMPLIES (AND (NENDP K TS (PLUS R TR) W)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS R TR) TS))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (PLUS R TR)
(PLUS TS (TIMES K W))))))
WARNING: When the linear lemma:
LESSP-PLUS-NTS*-TIMES-W-NLST*-PLUS-R-NTR*-LEMMA
is stored under (TIMES K W) it contains the free variables TR, R, and TS which
will be chosen by instantiating the hypothesis (NENDP K TS (PLUS R TR) W).
WARNING: Note that the proposed lemma:
LESSP-PLUS-NTS*-TIMES-W-NLST*-PLUS-R-NTR*-LEMMA
is to be stored as zero type prescription rules, zero compound recognizer
rules, one linear rule, and zero replacement rules.
Call the conjecture *1.
We will appeal to induction. Nine inductions are suggested by terms in
the conjecture. They merge into four likely candidate inductions, two 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 K) (p R TR TS K W))
(IMPLIES (AND (NOT (ZEROP K))
(LESSP (PLUS TS W) (PLUS R TR))
(p R TR (PLUS TS W) (SUB1 K) W))
(p R TR TS K W))
(IMPLIES (AND (NOT (ZEROP K))
(NOT (LESSP (PLUS TS W) (PLUS R TR))))
(p R TR TS K W))).
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. Note, however, the inductive
instance chosen for TS. The above induction scheme produces the following six
new conjectures:
Case 6. (IMPLIES (AND (ZEROP K)
(NENDP K TS (PLUS R TR) W)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS R TR) TS))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (PLUS R TR)
(PLUS TS (TIMES K W))))).
This simplifies, applying PLUS-COMMUTES1, and unfolding the definitions of
ZEROP, EQUAL, NENDP, TIMES, and PLUS, to:
T.
Case 5. (IMPLIES (AND (NOT (ZEROP K))
(LESSP (PLUS TS W) (PLUS R TR))
(NOT (NENDP (SUB1 K)
(PLUS TS W)
(PLUS R TR)
W))
(NENDP K TS (PLUS R TR) W)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS R TR) TS))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (PLUS R TR)
(PLUS TS (TIMES K W))))),
which simplifies, opening up ZEROP and NENDP, to:
T.
Case 4. (IMPLIES (AND (NOT (ZEROP K))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS R TR) (PLUS TS W))
(NENDP K TS (PLUS R TR) W)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS R TR) TS))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (PLUS R TR)
(PLUS TS (TIMES K W))))),
which simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (NOT (ZEROP K))
(LESSP (PLUS TS W) (PLUS R TR))
(NOT (LESSP TR (PLUS (PLUS TS W) W)))
(NENDP K TS (PLUS R TR) W)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS R TR) TS))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (PLUS R TR)
(PLUS TS (TIMES K W))))),
which simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP K))
(LESSP (PLUS TS W) (PLUS R TR))
(NOT (LESSP (PLUS R TR)
(PLUS (PLUS TS W)
(TIMES (SUB1 K) W))))
(NENDP K TS (PLUS R TR) W)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS R TR) TS))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (PLUS R TR)
(PLUS TS (TIMES K W))))),
which simplifies, applying PLUS-ASSOCIATES, and opening up the functions
ZEROP, NENDP, and TIMES, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP K))
(NOT (LESSP (PLUS TS W) (PLUS R TR)))
(NENDP K TS (PLUS R TR) W)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS R TR) TS))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (PLUS R TR)
(PLUS TS (TIMES K W))))).
This simplifies, opening up ZEROP and NENDP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-PLUS-NTS*-TIMES-W-NLST*-PLUS-R-NTR*-LEMMA
(PROVE-LEMMA NOT-LESSP-PLUS-R-NTR*-PLUS-NTS*-TIMES-W-NLST*
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (PLUS R (NTR* K TS TR W R))
(PLUS (NTS* K TS TR W R)
(TIMES W (NLST* K TS TR W R)))))))
WARNING: Note that the proposed lemma:
NOT-LESSP-PLUS-R-NTR*-PLUS-NTS*-TIMES-W-NLST*
is to be stored as zero type prescription rules, zero compound recognizer
rules, one linear rule, and zero replacement rules.
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (PLUS R (NTR* K TS TR W R))
(PLUS (NTS* K TS TR W R)
(TIMES W (NLST* K TS TR W R)))))),
which we will name *1.
Perhaps we can prove it by induction. Nine inductions are suggested by
terms in the conjecture. They merge into four likely candidate inductions,
two 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 (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W))
(p R K TS TR W))
(IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(p R
(NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W))
(p R K TS TR W))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, SUB1-ADD1, NLST+-EQUAL-N,
ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LESSP-NLST+, and the definitions
of LISTP, ORDINALP, NLST+, LESSP, ORD-LESSP, EQUAL, OR, ZEROP, NTS+, and NENDP
establish that the measure:
(CONS (CONS (ADD1 K) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each induction
step of the scheme. The above induction scheme produces the following five
new conjectures:
Case 5. (IMPLIES (AND (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (PLUS R (NTR* K TS TR W R))
(PLUS (NTS* K TS TR W R)
(TIMES W (NLST* K TS TR W R)))))).
This simplifies, appealing to the lemmas PLUS-COMMUTES1 and TIMES-COMMUTES1,
and unfolding ZEROP, OR, NTR*, NTS*, and NLST*, to:
(IMPLIES (AND (NENDP K TS (PLUS R TR) W)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (PLUS R TR)
(PLUS TS (TIMES K W))))),
which again simplifies, using linear arithmetic and applying
LESSP-PLUS-NTS*-TIMES-W-NLST*-PLUS-R-NTR*-LEMMA, to:
T.
Case 4. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(NOT (NUMBERP (NTS+ K TS (PLUS TR R) W)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (PLUS R (NTR* K TS TR W R))
(PLUS (NTS* K TS TR W R)
(TIMES W (NLST* K TS TR W R)))))).
This simplifies, rewriting with the lemma PLUS-COMMUTES1, and unfolding the
functions ZEROP and OR, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(LESSP (PLUS TR R)
(NTS+ K TS (PLUS TR R) W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (PLUS R (NTR* K TS TR W R))
(PLUS (NTS* K TS TR W R)
(TIMES W (NLST* K TS TR W R)))))).
This simplifies, using linear arithmetic and applying NOT-LESSP-NTS+, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(NOT (LESSP (PLUS TR R)
(PLUS (NTS+ K TS (PLUS TR R) W) W)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (PLUS R (NTR* K TS TR W R))
(PLUS (NTS* K TS TR W R)
(TIMES W (NLST* K TS TR W R)))))),
which simplifies, rewriting with PLUS-COMMUTES1, and expanding ZEROP, OR,
NTR*, NTS*, and NLST*, to the new goal:
(IMPLIES (AND (NOT (NENDP K TS (PLUS R TR) W))
(NOT (LESSP (PLUS R TR)
(PLUS W (NTS+ K TS (PLUS R TR) W))))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (PLUS R
(NTR* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R))
(PLUS (NTS* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R)
(TIMES W
(NLST* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R)))))),
which again simplifies, using linear arithmetic and applying the lemma
LESSP-NTS+, to:
T.
Case 1. (IMPLIES
(AND (NOT (OR (ZEROP R)
(NENDP K TS (PLUS TR R) W)))
(NOT (LESSP (PLUS R
(NTR* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R))
(PLUS (NTS* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R)
(TIMES W
(NLST* (NLST+ K TS (PLUS TR R) W)
(NTS+ K TS (PLUS TR R) W)
(PLUS TR R)
W R)))))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(NOT (LESSP (PLUS R (NTR* K TS TR W R))
(PLUS (NTS* K TS TR W R)
(TIMES W (NLST* K TS TR W R)))))),
which simplifies, appealing to the lemma PLUS-COMMUTES1, and opening up the
functions ZEROP, OR, NTR*, NTS*, and NLST*, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
NOT-LESSP-PLUS-R-NTR*-PLUS-NTS*-TIMES-W-NLST*
(PROVE-LEMMA HELPER1
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LESSP (PLUS TS W W) (PLUS R TR))
(LESSP (PLUS TS W) (PLUS R TR))
(NOT (LESSP (PLUS R TR) (PLUS TS W W))))
(EQUAL (WARP (LST+ REST
(PLUS TS W W)
(PLUS R TR)
W)
(NTS+ (LEN REST)
(PLUS TS W W)
(PLUS R TR)
W)
(PLUS R TR)
W R)
(WARP REST
(PLUS TS W W)
(PLUS R TR)
W R)))
((EXPAND (LST+ REST
(PLUS TS W W)
(PLUS R TR)
W)
(NTS+ (LEN REST)
(PLUS TS W W)
(PLUS R TR)
W))))
This simplifies, appealing to the lemmas PLUS-ASSOCIATES and EQUAL-LEN-0, and
unfolding the definitions of LST+ and NTS+, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LESSP (PLUS TS W W) (PLUS R TR))
(LESSP (PLUS TS W) (PLUS R TR))
(NOT (LESSP (PLUS R TR) (PLUS TS W W)))
(NOT (LESSP (PLUS R TR) (PLUS TS W W W))))
(EQUAL (WARP (LST+ (CDR REST)
(PLUS TS W W W)
(PLUS R TR)
W)
(NTS+ (SUB1 (LEN REST))
(PLUS TS W W W)
(PLUS R TR)
W)
(PLUS R TR)
W R)
(WARP REST
(PLUS TS W W)
(PLUS R TR)
W R))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
HELPER1
(PROVE-LEMMA HELPER5
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS TS W W) (PLUS R TR))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W))))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (WARP (CONS 'Q REST)
(PLUS TS (TIMES K W))
(PLUS R TR)
W R)
(CONS 'Q
(WARP REST
(PLUS TS W (TIMES K W))
(PLUS TR (TIMES 2 R))
W R))))
((EXPAND (WARP (CONS 'Q REST)
(PLUS TS W (TIMES W (SUB1 K)))
(PLUS R TR)
W R)
(TIMES 2 R))))
This formula simplifies, using linear arithmetic, applying PLUS-COMMUTES1,
TIMES-COMMUTES1, PLUS-ASSOCIATES, CDR-CONS, EQUAL-LEN-0, SUB1-ADD1,
NENDP-IS-USUALLY-F, LEN-ENDP, CAR-CONS, LEN-TS+, and PLUS-COMMUTES2, and
opening up the functions TIMES, EQUAL, NUMBERP, SUB1, PLUS, WARP, LEN, LESSP,
RECONCILE-SIGNALS, SIG, LST+, and NTS+, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS TS W W) (PLUS R TR))
(LESSP (PLUS TS W) (PLUS R TR))
(EQUAL K 0)
(LESSP (PLUS R TR) (PLUS TS W 0))
(NOT (LESSP (PLUS R R TR) (PLUS TS W)))
(LESSP (PLUS R R TR) (PLUS TS W W)))
(EQUAL (WARP (CONS 'Q REST)
TS
(PLUS R TR)
W R)
(CONS 'Q
(WARP REST
(PLUS TS W)
(PLUS R R TR)
W R)))).
But this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
HELPER5
(PROVE-LEMMA HELPER7
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(NOT (LESSP (PLUS R TR) (PLUS TS W W)))
(LESSP (PLUS R TR) (PLUS TS W W W)))
(EQUAL (WARP (CONS FLG1 (CONS 'Q REST))
TS TR W R)
(CONS 'Q
(WARP REST
(PLUS TS W W)
(PLUS R TR)
W R))))
((EXPAND (WARP (CONS FLG1 (CONS 'Q REST))
TS TR W R))))
This conjecture simplifies, using linear arithmetic, applying PLUS-COMMUTES1,
CDR-CONS, NENDP-IS-USUALLY-F, LEN-ENDP, CAR-CONS, PLUS-ASSOCIATES, SUB1-ADD1,
LEN-TS+, and CONS-EQUAL, and opening up WARP, LEN, RECONCILE-SIGNALS, SIG,
LST+, NTS+, and EQUAL, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(NOT (LESSP (PLUS R TR) (PLUS TS W W)))
(LESSP (PLUS R TR) (PLUS TS W W W))
(LESSP (PLUS R TR) (PLUS TS W)))
(EQUAL (WARP (CONS FLG1 (CONS 'Q REST))
TS
(PLUS R TR)
W R)
(WARP REST
(PLUS TS W W)
(PLUS R TR)
W R))).
This again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
HELPER7
(PROVE-LEMMA HELPER8
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(NOT (EQUAL (PLUS R TR) (PLUS TS W)))
(NOT (LESSP (PLUS R TR) (PLUS TS W W))))
(EQUAL (WARP (CONS 'Q REST) TS TR W R)
(CONS 'Q
(WARP (CDR REST)
(PLUS TS W W)
(PLUS R TR)
W R))))
((EXPAND (WARP (CONS 'Q REST) TS TR W R)
(LST+ (CDR REST)
(PLUS TS W W)
(PLUS R TR)
W)
(NTS+ (LEN (CDR REST))
(PLUS TS W W)
(PLUS R TR)
W)
(LST+ REST (PLUS TS W) (PLUS R TR) W)
(NTS+ (ADD1 (LEN (CDR REST)))
(PLUS TS W)
(PLUS R TR)
W))))
This formula simplifies, rewriting with the lemmas PLUS-COMMUTES1, CDR-CONS,
EQUAL-LEN-0, SUB1-ADD1, NENDP-IS-USUALLY-F, LEN-ENDP, CAR-CONS,
PLUS-ASSOCIATES, LEN-TS+, and CONS-EQUAL, and opening up WARP, LEN, LESSP,
EQUAL, NUMBERP, SUB1, RECONCILE-SIGNALS, SIG, and NTS+, to two new formulas:
Case 2. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(NOT (EQUAL (PLUS R TR) (PLUS TS W)))
(NOT (LESSP (PLUS R TR) (PLUS TS W W)))
(NOT (LESSP (PLUS R TR) (PLUS TS W W W))))
(EQUAL (WARP (LST+ (CONS 'Q REST)
TS
(PLUS R TR)
W)
(NTS+ (SUB1 (LEN (CDR REST)))
(PLUS TS W W W)
(PLUS R TR)
W)
(PLUS R TR)
W R)
(WARP (CDR REST)
(PLUS TS W W)
(PLUS R TR)
W R))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(NOT (EQUAL (PLUS R TR) (PLUS TS W)))
(NOT (LESSP (PLUS R TR) (PLUS TS W W)))
(LESSP (PLUS R TR) (PLUS TS W W W)))
(EQUAL (WARP (LST+ (CONS 'Q REST)
TS
(PLUS R TR)
W)
(PLUS TS W W)
(PLUS R TR)
W R)
(WARP (CDR REST)
(PLUS TS W W)
(PLUS R TR)
W R))),
which again simplifies, applying the lemmas PLUS-ASSOCIATES and CDR-CONS,
and opening up LST+, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
HELPER8
(PROVE-LEMMA HELPER9
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS R TR) (PLUS TS W W))
(NOT (LESSP (PLUS R R TR) (PLUS TS W W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W W W))))
(EQUAL (WARP (CONS FLG1 (CONS 'Q REST))
TS TR W R)
(CONS 'Q
(CONS 'Q
(WARP (CDR REST)
(PLUS TS W W W)
(PLUS R R TR)
W R)))))
((EXPAND (WARP (CONS FLG1 (CONS 'Q REST))
TS TR W R))))
This formula simplifies, using linear arithmetic, rewriting with
PLUS-COMMUTES1, CDR-CONS, NENDP-IS-USUALLY-F, LEN-ENDP, CAR-CONS,
PLUS-ASSOCIATES, SUB1-ADD1, LEN-TS+, and CONS-EQUAL, and expanding the
functions WARP, LEN, RECONCILE-SIGNALS, SIG, LST+, NTS+, and EQUAL, to two new
goals:
Case 2. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS R TR) (PLUS TS W W))
(NOT (LESSP (PLUS R R TR) (PLUS TS W W)))
(NOT (LESSP (PLUS R R TR) (PLUS TS W W W)))
(NOT (LESSP (PLUS R TR) (PLUS TS W))))
(EQUAL (WARP (CONS 'Q REST)
(PLUS TS W)
(PLUS R TR)
W R)
(CONS 'Q
(WARP (CDR REST)
(PLUS TS W W W)
(PLUS R R TR)
W R)))),
which again simplifies, using linear arithmetic and applying PLUS-ASSOCIATES
and HELPER8, to:
T.
Case 1. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS R TR) (PLUS TS W W))
(NOT (LESSP (PLUS R R TR) (PLUS TS W W)))
(NOT (LESSP (PLUS R R TR) (PLUS TS W W W)))
(LESSP (PLUS R TR) (PLUS TS W)))
(EQUAL (WARP (CONS FLG1 (CONS 'Q REST))
TS
(PLUS R TR)
W R)
(CONS 'Q
(WARP (CDR REST)
(PLUS TS W W W)
(PLUS R R TR)
W R)))).
However this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
HELPER9
(PROVE-LEMMA HELPER10
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS R TR) (PLUS TS W W))
(NOT (LESSP (PLUS R R TR) (PLUS TS W W)))
(LESSP (PLUS R R TR) (PLUS TS W W W)))
(EQUAL (WARP (CONS FLG1 (CONS 'Q REST))
TS TR W R)
(CONS 'Q
(CONS 'Q
(WARP REST
(PLUS TS W W)
(PLUS R R TR)
W R)))))
((EXPAND (WARP (CONS FLG1 (CONS 'Q REST))
TS TR W R)
(WARP (CONS 'Q REST)
(PLUS TS W)
(PLUS R TR)
W R))))
This simplifies, using linear arithmetic, rewriting with PLUS-COMMUTES1,
CDR-CONS, NENDP-IS-USUALLY-F, LEN-ENDP, CAR-CONS, PLUS-ASSOCIATES, SUB1-ADD1,
LEN-TS+, and CONS-EQUAL, and expanding the definitions of WARP, LEN,
RECONCILE-SIGNALS, SIG, LST+, NTS+, and EQUAL, to the following two new
formulas:
Case 2. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS R TR) (PLUS TS W W))
(NOT (LESSP (PLUS R R TR) (PLUS TS W W)))
(LESSP (PLUS R R TR) (PLUS TS W W W))
(NOT (LESSP (PLUS R TR) (PLUS TS W))))
(EQUAL (WARP (CONS 'Q REST)
(PLUS TS W)
(PLUS R TR)
W R)
(CONS 'Q
(WARP REST
(PLUS TS W W)
(PLUS R R TR)
W R)))).
But this again simplifies, using linear arithmetic, rewriting with
PLUS-COMMUTES1, PLUS-ASSOCIATES, CDR-CONS, EQUAL-LEN-0, SUB1-ADD1,
NENDP-IS-USUALLY-F, LEN-ENDP, CAR-CONS, and LEN-TS+, and expanding the
definitions of WARP, LEN, LESSP, EQUAL, NUMBERP, SUB1, RECONCILE-SIGNALS,
SIG, LST+, and NTS+, to:
T.
Case 1. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS R TR) (PLUS TS W W))
(NOT (LESSP (PLUS R R TR) (PLUS TS W W)))
(LESSP (PLUS R R TR) (PLUS TS W W W))
(LESSP (PLUS R TR) (PLUS TS W)))
(EQUAL (WARP (CONS FLG1 (CONS 'Q REST))
TS
(PLUS R TR)
W R)
(CONS 'Q
(WARP REST
(PLUS TS W W)
(PLUS R R TR)
W R)))).
However this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
HELPER10
(PROVE-LEMMA HELPER11
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS R TR) (PLUS TS W W))
(LESSP (PLUS R R TR) (PLUS TS W W))
(LESSP (PLUS R R TR) (PLUS TS W W W)))
(EQUAL (WARP (CONS FLG1 (CONS 'Q REST))
TS TR W R)
(CONS 'Q
(CONS 'Q
(CONS 'Q
(WARP REST
(PLUS TS W W)
(PLUS TR (TIMES 3 R))
W R))))))
((EXPAND (WARP (CONS FLG1 (CONS 'Q REST))
TS TR W R)
(WARP (CONS 'Q REST)
(PLUS TS W)
(PLUS R R TR)
W R)
(WARP (CONS 'Q REST)
(PLUS TS W)
(PLUS R TR)
W R)
(TIMES 2 R)
(TIMES 3 R))))
This simplifies, using linear arithmetic, applying PLUS-COMMUTES1, CDR-CONS,
NENDP-IS-USUALLY-F, LEN-ENDP, CAR-CONS, PLUS-ASSOCIATES, SUB1-ADD1, LEN-TS+,
PLUS-COMMUTES2, and CONS-EQUAL, and unfolding the definitions of WARP, LEN,
PLUS, SUB1, NUMBERP, EQUAL, TIMES, RECONCILE-SIGNALS, SIG, LST+, and NTS+, to
two new conjectures:
Case 2. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS R TR) (PLUS TS W W))
(LESSP (PLUS R R TR) (PLUS TS W W))
(LESSP (PLUS R R TR) (PLUS TS W W W))
(NOT (LESSP (PLUS R TR) (PLUS TS W))))
(EQUAL (WARP (CONS 'Q REST)
(PLUS TS W)
(PLUS R TR)
W R)
(CONS 'Q
(CONS 'Q
(WARP REST
(PLUS TS W W)
(PLUS R R R TR)
W R))))),
which again simplifies, using linear arithmetic, applying PLUS-COMMUTES1,
PLUS-ASSOCIATES, CDR-CONS, EQUAL-LEN-0, SUB1-ADD1, NENDP-IS-USUALLY-F,
LEN-ENDP, CAR-CONS, LEN-TS+, and CONS-EQUAL, and unfolding the functions
WARP, LEN, LESSP, PLUS, SUB1, NUMBERP, EQUAL, TIMES, RECONCILE-SIGNALS, SIG,
LST+, and NTS+, to the following three new conjectures:
Case 2.3.
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS R TR) (PLUS TS W W))
(LESSP (PLUS R R TR) (PLUS TS W W))
(LESSP (PLUS R R TR) (PLUS TS W W W))
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(NOT (LESSP (PLUS R R R TR) (PLUS TS W W)))
(LESSP (PLUS R R R TR)
(PLUS TS W W W)))
(EQUAL (WARP (LST+ REST
(PLUS TS W W)
(PLUS R R R TR)
W)
(PLUS TS W W)
(PLUS R R R TR)
W R)
(WARP REST
(PLUS TS W W)
(PLUS R R R TR)
W R))).
But this again simplifies, rewriting with PLUS-ASSOCIATES, and opening up
LST+, to:
T.
Case 2.2.
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS R TR) (PLUS TS W W))
(LESSP (PLUS R R TR) (PLUS TS W W))
(LESSP (PLUS R R TR) (PLUS TS W W W))
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(NOT (LESSP (PLUS R R R TR) (PLUS TS W W)))
(NOT (LESSP (PLUS R R R TR)
(PLUS TS W W W))))
(EQUAL (WARP (LST+ REST
(PLUS TS W W)
(PLUS R R R TR)
W)
(NTS+ (LEN (CDR REST))
(PLUS TS W W W)
(PLUS R R R TR)
W)
(PLUS R R R TR)
W R)
(WARP REST
(PLUS TS W W)
(PLUS R R R TR)
W R))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS R TR) (PLUS TS W W))
(LESSP (PLUS R R TR) (PLUS TS W W))
(LESSP (PLUS R R TR) (PLUS TS W W W))
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(LESSP (PLUS R R R TR) (PLUS TS W W)))
(EQUAL (WARP (CONS 'Q REST)
(PLUS TS W)
(PLUS R R R TR)
W R)
(WARP REST
(PLUS TS W W)
(PLUS R R R TR)
W R))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS R TR) (PLUS TS W W))
(LESSP (PLUS R R TR) (PLUS TS W W))
(LESSP (PLUS R R TR) (PLUS TS W W W))
(LESSP (PLUS R TR) (PLUS TS W)))
(EQUAL (WARP (CONS FLG1 (CONS 'Q REST))
TS
(PLUS R TR)
W R)
(CONS 'Q
(CONS 'Q
(WARP REST
(PLUS TS W W)
(PLUS R R R TR)
W R))))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
HELPER11
(PROVE-LEMMA LESSP-TIMES-18
(REWRITE)
(IMPLIES (LISTP MSG)
(NOT (LESSP (TIMES 18 (LEN MSG)) 18))))
WARNING: Note that the proposed lemma LESSP-TIMES-18 is to be stored as zero
type prescription rules, zero compound recognizer rules, one linear rule, and
zero replacement rules.
Name the conjecture *1.
Perhaps we can prove it by induction. There is only one plausible
induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP MSG) (p MSG))
(IMPLIES (AND (NOT (NLISTP MSG)) (p (CDR MSG)))
(p MSG))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT MSG) 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 conjectures:
Case 3. (IMPLIES (AND (NLISTP MSG) (LISTP MSG))
(NOT (LESSP (TIMES 18 (LEN MSG)) 18))).
This simplifies, opening up NLISTP, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP MSG))
(NOT (LISTP (CDR MSG)))
(LISTP MSG))
(NOT (LESSP (TIMES 18 (LEN MSG)) 18))).
This simplifies, rewriting with TIMES-ADD1, and expanding the functions
NLISTP and LEN, to the formula:
(IMPLIES (AND (NOT (LISTP (CDR MSG)))
(LISTP MSG))
(NOT (LESSP (PLUS 18 (TIMES 18 (LEN (CDR MSG))))
18))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP MSG))
(NOT (LESSP (TIMES 18 (LEN (CDR MSG))) 18))
(LISTP MSG))
(NOT (LESSP (TIMES 18 (LEN MSG)) 18))),
which simplifies, applying TIMES-ADD1, and unfolding NLISTP and LEN, to:
(IMPLIES (AND (NOT (LESSP (TIMES 18 (LEN (CDR MSG))) 18))
(LISTP MSG))
(NOT (LESSP (PLUS 18 (TIMES 18 (LEN (CDR MSG))))
18))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-TIMES-18
(PROVE-LEMMA LISTN-ADD1
(REWRITE)
(EQUAL (LISTN (ADD1 N) FLG)
(CONS FLG (LISTN N FLG)))
((ENABLE LISTN)))
This formula simplifies, applying SUB1-ADD1, CAR-CONS, CDR-CONS, and
CONS-EQUAL, and opening up the function LISTN, to:
(IMPLIES (NOT (NUMBERP N))
(EQUAL (LISTN 0 FLG) (LISTN N FLG))),
which again simplifies, opening up the functions EQUAL and LISTN, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LISTN-ADD1
(PROVE-LEMMA HELPER14
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(LESSP (PLUS R TR) (PLUS TS W W)))
(EQUAL (WARP (CONS 'Q REST) TS TR W R)
(CONS 'Q
(WARP REST
(PLUS TS W)
(PLUS R TR)
W R))))
((EXPAND (WARP (CONS 'Q REST) TS TR W R))))
This simplifies, using linear arithmetic, applying PLUS-COMMUTES1, CDR-CONS,
LESSP-TIMES-18, NENDP-IS-USUALLY-F, LEN-ENDP, CAR-CONS, PLUS-ASSOCIATES,
SUB1-ADD1, and LEN-TS+, and expanding WARP, LEN, RECONCILE-SIGNALS, SIG, LST+,
and NTS+, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
HELPER14
(PROVE-LEMMA HELPER15
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS R TR) (PLUS TS W))
(NOT (LESSP (PLUS R R TR) (PLUS TS W)))
(LESSP (PLUS R R TR) (PLUS TS W W)))
(EQUAL (WARP (CONS 'Q REST) TS TR W R)
(CONS 'Q
(CONS 'Q
(WARP REST
(PLUS TS W)
(PLUS R R TR)
W R)))))
((EXPAND (WARP (CONS 'Q REST) TS TR W R))))
This conjecture simplifies, using linear arithmetic, applying PLUS-COMMUTES1,
CDR-CONS, LESSP-TIMES-18, NENDP-IS-USUALLY-F, LEN-ENDP, CAR-CONS, LEN-TS+, and
HELPER14, and opening up WARP, LEN, RECONCILE-SIGNALS, SIG, LST+, and NTS+, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
HELPER15
(PROVE-LEMMA WARP-APP-ACROSS-GAP
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(NENDP K TS (PLUS R TR) W))
(EQUAL (WARP (APP (LISTN K FLG1) (CONS 'Q REST))
TS TR W R)
(APP (LISTN (NQG K TS TR W R) 'Q)
(WARP (CDRN (DWG K TS TR W R) REST)
(TSG K TS TR W R)
(TRG K TS TR W R)
W R))))
((DO-NOT-INDUCT T)
(ENABLE LISTN)
(EXPAND (NENDP K TS (PLUS R TR) W)
(NENDP (SUB1 K)
(PLUS TS W)
(PLUS R TR)
W)
(NENDP (SUB1 (SUB1 K))
(PLUS TS W W)
(PLUS R TR)
W)
(TIMES 2 R))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to the goal:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(NENDP K TS (PLUS R TR) W))
(EQUAL (WARP (APP (LISTN K FLG1) (CONS 'Q REST))
TS TR W R)
(APP (LISTN (NQG K TS TR W R) 'Q)
(WARP (CDRN (DWG K TS TR W R) REST)
(TSG K TS TR W R)
(TRG K TS TR W R)
W R)))).
This simplifies, using linear arithmetic, rewriting with PLUS-COMMUTES1,
PLUS-ASSOCIATES, TIMES-COMMUTES1, PLUS-COMMUTES2, LEN-LISTN, CDR-CONS,
PLUS-ADD1, LESSP-TIMES-18, NENDP-IS-USUALLY-F, SUB1-ADD1, and WARP-APP-GAP,
and expanding TIMES, EQUAL, NUMBERP, SUB1, PLUS, NENDP, LISTN, LISTP, APP, NQG,
DWG, TSG, TRG, LEN, LST+, and NTS+, to 35 new conjectures:
Case 35.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(EQUAL K 0)
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(LESSP (PLUS R TR) (PLUS TS W W)))
(EQUAL (WARP (CONS 'Q REST) TS TR W R)
(APP (LISTN 1 'Q)
(WARP (CDRN 0 REST)
(PLUS 0 TS W (TIMES W 0))
(PLUS TR (TIMES R 1))
W R)))),
which again simplifies, rewriting with HELPER14, LISTN-ADD1, TIMES-COMMUTES1,
and PLUS-COMMUTES1, and expanding the functions NUMBERP, EQUAL, LISTN, CONS,
CDRN, TIMES, PLUS, SUB1, CDR, CAR, LISTP, and APP, to:
T.
Case 34.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(EQUAL K 0)
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(EQUAL (PLUS R TR) (PLUS TS W)))
(EQUAL (WARP (CONS 'Q REST) TS TR W R)
(APP (LISTN 1 'Q)
(WARP (CDRN 0 REST)
(PLUS 0 TS W (TIMES W 0))
(PLUS TR (TIMES R 1))
W R)))).
This again simplifies, using linear arithmetic, applying the lemmas HELPER14,
LISTN-ADD1, TIMES-COMMUTES1, and PLUS-COMMUTES1, and opening up the
functions NUMBERP, EQUAL, LISTN, CONS, CDRN, TIMES, PLUS, SUB1, CDR, CAR,
LISTP, and APP, to:
T.
Case 33.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(EQUAL K 0)
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(NOT (EQUAL (PLUS R TR) (PLUS TS W)))
(NOT (LESSP (PLUS R TR) (PLUS TS W W))))
(EQUAL (WARP (CONS 'Q REST) TS TR W R)
(APP (LISTN 1 'Q)
(WARP (CDRN 1 REST)
(PLUS 0 TS W (TIMES W 1))
(PLUS TR (TIMES R 1))
W R)))),
which again simplifies, using linear arithmetic, applying PLUS-COMMUTES1,
HELPER8, LISTN-ADD1, and TIMES-COMMUTES1, and opening up the functions
NUMBERP, PLUS, SUB1, EQUAL, TIMES, LISTN, CONS, CDRN, CDR, CAR, LISTP, and
APP, to:
T.
Case 32.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(EQUAL K 0)
(LESSP (PLUS R TR) (PLUS TS W))
(LESSP (PLUS R R TR) (PLUS TS W))
(LESSP (PLUS R R TR) (PLUS TS W W)))
(EQUAL (WARP (CONS 'Q REST) TS TR W R)
(APP (LISTN 3 'Q)
(WARP (CDRN 0 REST)
(PLUS 0 TS W (TIMES W 0))
(PLUS TR (TIMES R 3))
W R)))).
This again simplifies, using linear arithmetic, to:
T.
Case 31.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(EQUAL K 0)
(LESSP (PLUS R TR) (PLUS TS W))
(LESSP (PLUS R R TR) (PLUS TS W))
(NOT (LESSP (PLUS R R TR) (PLUS TS W W))))
(EQUAL (WARP (CONS 'Q REST) TS TR W R)
(APP (LISTN 3 'Q)
(WARP (CDRN 1 REST)
(PLUS 0 TS W (TIMES W 1))
(PLUS TR (TIMES R 3))
W R)))),
which again simplifies, using linear arithmetic, to:
T.
Case 30.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(EQUAL K 0)
(LESSP (PLUS R TR) (PLUS TS W))
(NOT (LESSP (PLUS R R TR) (PLUS TS W)))
(LESSP (PLUS R R TR) (PLUS TS W W)))
(EQUAL (WARP (CONS 'Q REST) TS TR W R)
(APP (LISTN 2 'Q)
(WARP (CDRN 0 REST)
(PLUS 0 TS W (TIMES W 0))
(PLUS TR (TIMES R 2))
W R)))),
which again simplifies, applying HELPER15, LISTN-ADD1, TIMES-COMMUTES1,
PLUS-COMMUTES1, and PLUS-COMMUTES2, and opening up NUMBERP, EQUAL, LISTN,
CONS, CDRN, TIMES, PLUS, SUB1, CDR, CAR, LISTP, and APP, to:
T.
Case 29.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(EQUAL K 0)
(LESSP (PLUS R TR) (PLUS TS W))
(NOT (LESSP (PLUS R R TR) (PLUS TS W)))
(NOT (LESSP (PLUS R R TR) (PLUS TS W W))))
(EQUAL (WARP (CONS 'Q REST) TS TR W R)
(APP (LISTN 2 'Q)
(WARP (CDRN 1 REST)
(PLUS 0 TS W (TIMES W 1))
(PLUS TR (TIMES R 2))
W R)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 28.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES K W))))
(LESSP (PLUS R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (LST+ REST
(PLUS TS W (TIMES K W))
(PLUS R TR)
W)
(PLUS TS W (TIMES K W))
(PLUS R TR)
W R))
(APP (LISTN 1 'Q)
(WARP (CDRN 0 REST)
(PLUS TS W (TIMES K W) (TIMES W 0))
(PLUS TR (TIMES R 1))
W R)))),
which again simplifies, applying PLUS-ASSOCIATES, PLUS-COMMUTES1, LISTN-ADD1,
TIMES-COMMUTES1, CAR-CONS, and CONS-EQUAL, and unfolding the definitions of
LST+, EQUAL, LISTN, CONS, CDRN, TIMES, PLUS, SUB1, NUMBERP, CDR, CAR, LISTP,
and APP, to the new goal:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES K W))))
(LESSP (PLUS R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
'Q)).
Applying the lemma CAR-CDR-ELIM, replace REST by (CONS Z X) to eliminate
(CDR REST) and (CAR REST). This produces the new goal:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES K W))))
(LESSP (PLUS R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (SIG (APP (LISTN K FLG1)
(CONS 'Q (CONS Z X)))
TS
(PLUS R TR)
W)
'Q)).
Applying the lemma SUB1-ELIM, replace K by (ADD1 V) to eliminate (SUB1 K)
and V by (ADD1 D) to eliminate (SUB1 V). We rely upon the type restriction
lemma noted when SUB1 was introduced to restrict the new variable. We thus
obtain the following three new formulas:
Case 28.3.
(IMPLIES (AND (EQUAL K 0)
(NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES K W))))
(LESSP (PLUS R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (SIG (APP (LISTN K FLG1)
(CONS 'Q (CONS Z X)))
TS
(PLUS R TR)
W)
'Q)).
However this further simplifies, using linear arithmetic, to:
T.
Case 28.2.
(IMPLIES (AND (EQUAL V 0)
(NUMBERP V)
(NOT (EQUAL (ADD1 V) 0))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 V) 0)
(NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES (ADD1 V) W))))
(LESSP (PLUS R TR)
(PLUS TS W W (TIMES (ADD1 V) W))))
(EQUAL (SIG (APP (LISTN (ADD1 V) FLG1)
(CONS 'Q (CONS Z X)))
TS
(PLUS R TR)
W)
'Q)),
which further simplifies, applying PLUS-COMMUTES1, LISTN-ADD1, CDR-CONS,
CAR-CONS, and PLUS-ASSOCIATES, and expanding the functions NUMBERP, EQUAL,
SUB1, TIMES, PLUS, LISTN, APP, LISTP, RECONCILE-SIGNALS, and SIG, to:
T.
Case 28.1.
(IMPLIES (AND (NUMBERP D)
(NOT (EQUAL (ADD1 D) 0))
(NOT (EQUAL (ADD1 (ADD1 D)) 0))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL D 0)
(NOT (LESSP (PLUS R TR)
(PLUS TS W
(TIMES (ADD1 (ADD1 D)) W))))
(LESSP (PLUS R TR)
(PLUS TS W W
(TIMES (ADD1 (ADD1 D)) W))))
(EQUAL (SIG (APP (LISTN (ADD1 (ADD1 D)) FLG1)
(CONS 'Q (CONS Z X)))
TS
(PLUS R TR)
W)
'Q)).
However this further simplifies, using linear arithmetic, to:
T.
Case 27.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES K W))))
(EQUAL (PLUS R TR)
(PLUS TS W (TIMES K W)))
(NOT (LESSP (PLUS R TR)
(PLUS TS W W (TIMES K W)))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (LST+ REST
(PLUS TS W (TIMES K W))
(PLUS R TR)
W)
(NTS+ (LEN (CDR REST))
(PLUS TS W W (TIMES K W))
(PLUS R TR)
W)
(PLUS R TR)
W R))
(APP (LISTN 1 'Q)
(WARP (CDRN 0 REST)
(PLUS TS W (TIMES K W) (TIMES W 0))
(PLUS TR (TIMES R 1))
W R)))),
which again simplifies, using linear arithmetic, to:
T.
Case 26.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES K W))))
(NOT (EQUAL (PLUS R TR)
(PLUS TS W (TIMES K W))))
(NOT (LESSP (PLUS R TR)
(PLUS TS W W (TIMES K W)))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (LST+ REST
(PLUS TS W (TIMES K W))
(PLUS R TR)
W)
(NTS+ (LEN (CDR REST))
(PLUS TS W W (TIMES K W))
(PLUS R TR)
W)
(PLUS R TR)
W R))
(APP (LISTN 1 'Q)
(WARP (CDRN 1 REST)
(PLUS TS W (TIMES K W) (TIMES W 1))
(PLUS TR (TIMES R 1))
W R)))),
which again simplifies, using linear arithmetic and rewriting with the lemma
LESSP-TIMES, to two new conjectures:
Case 26.2.
(IMPLIES (AND (EQUAL (SUB1 K) 0)
(NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES K W))))
(NOT (EQUAL (PLUS R TR)
(PLUS TS W (TIMES K W))))
(NOT (LESSP (PLUS R TR)
(PLUS TS W W (TIMES K W)))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (LST+ REST
(PLUS TS W (TIMES K W))
(PLUS R TR)
W)
(NTS+ (LEN (CDR REST))
(PLUS TS W W (TIMES K W))
(PLUS R TR)
W)
(PLUS R TR)
W R))
(APP (LISTN 1 'Q)
(WARP (CDRN 1 REST)
(PLUS TS W (TIMES K W) (TIMES W 1))
(PLUS TR (TIMES R 1))
W R)))),
which again simplifies, using linear arithmetic and appealing to the lemma
LESSP-TIMES, to:
(IMPLIES (AND (EQUAL K 0)
(EQUAL (SUB1 K) 0)
(NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 0) 0)
(NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES K W))))
(NOT (EQUAL (PLUS R TR)
(PLUS TS W (TIMES K W))))
(NOT (LESSP (PLUS R TR)
(PLUS TS W W (TIMES K W)))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (LST+ REST
(PLUS TS W (TIMES K W))
(PLUS R TR)
W)
(NTS+ (LEN (CDR REST))
(PLUS TS W W (TIMES K W))
(PLUS R TR)
W)
(PLUS R TR)
W R))
(APP (LISTN 1 'Q)
(WARP (CDRN 1 REST)
(PLUS TS W (TIMES K W) (TIMES W 1))
(PLUS TR (TIMES R 1))
W R)))).
This again simplifies, applying PLUS-COMMUTES1, CDR-CONS, CAR-CONS,
LISTN-ADD1, TIMES-COMMUTES1, and CONS-EQUAL, and opening up SUB1, EQUAL,
NUMBERP, TIMES, PLUS, LISTN, LISTP, APP, RECONCILE-SIGNALS, SIG, CONS,
CDRN, CDR, and CAR, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(NOT (EQUAL (PLUS R TR) (PLUS TS W)))
(NOT (LESSP (PLUS R TR) (PLUS TS W W))))
(EQUAL (WARP (LST+ REST (PLUS TS W) (PLUS R TR) W)
(NTS+ (LEN (CDR REST))
(PLUS TS W W)
(PLUS R TR)
W)
(PLUS R TR)
W R)
(WARP (CDR REST)
(PLUS TS W W)
(PLUS R TR)
W R))).
Applying the lemma CAR-CDR-ELIM, replace REST by (CONS Z X) to eliminate
(CDR REST) and (CAR REST). This produces:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(NOT (EQUAL (PLUS R TR) (PLUS TS W)))
(NOT (LESSP (PLUS R TR) (PLUS TS W W))))
(EQUAL (WARP (LST+ (CONS Z X)
(PLUS TS W)
(PLUS R TR)
W)
(NTS+ (LEN X)
(PLUS TS W W)
(PLUS R TR)
W)
(PLUS R TR)
W R)
(WARP X
(PLUS TS W W)
(PLUS R TR)
W R))),
which finally simplifies, using linear arithmetic, applying CDR-CONS,
PLUS-ASSOCIATES, PLUS-COMMUTES1, and HELPER1, and opening up the
definitions of LST+, PLUS, SUB1, NUMBERP, EQUAL, and TIMES, to:
T.
Case 26.1.
(IMPLIES (AND (EQUAL K 0)
(NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES K W))))
(NOT (EQUAL (PLUS R TR)
(PLUS TS W (TIMES K W))))
(NOT (LESSP (PLUS R TR)
(PLUS TS W W (TIMES K W)))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (LST+ REST
(PLUS TS W (TIMES K W))
(PLUS R TR)
W)
(NTS+ (LEN (CDR REST))
(PLUS TS W W (TIMES K W))
(PLUS R TR)
W)
(PLUS R TR)
W R))
(APP (LISTN 1 'Q)
(WARP (CDRN 1 REST)
(PLUS TS W (TIMES K W) (TIMES W 1))
(PLUS TR (TIMES R 1))
W R)))).
But this again simplifies, applying PLUS-COMMUTES1, CDR-CONS, CAR-CONS,
LISTN-ADD1, TIMES-COMMUTES1, and CONS-EQUAL, and unfolding the functions
NUMBERP, SUB1, EQUAL, TIMES, PLUS, LISTN, LISTP, APP, RECONCILE-SIGNALS,
SIG, CONS, CDRN, CDR, and CAR, to the new conjecture:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(NOT (EQUAL (PLUS R TR) (PLUS TS W)))
(NOT (LESSP (PLUS R TR) (PLUS TS W W))))
(EQUAL (WARP (LST+ REST (PLUS TS W) (PLUS R TR) W)
(NTS+ (LEN (CDR REST))
(PLUS TS W W)
(PLUS R TR)
W)
(PLUS R TR)
W R)
(WARP (CDR REST)
(PLUS TS W W)
(PLUS R TR)
W R))).
Applying the lemma CAR-CDR-ELIM, replace REST by (CONS Z X) to eliminate
(CDR REST) and (CAR REST). This produces the new goal:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(NOT (LESSP (PLUS R TR) (PLUS TS W)))
(NOT (EQUAL (PLUS R TR) (PLUS TS W)))
(NOT (LESSP (PLUS R TR) (PLUS TS W W))))
(EQUAL (WARP (LST+ (CONS Z X)
(PLUS TS W)
(PLUS R TR)
W)
(NTS+ (LEN X)
(PLUS TS W W)
(PLUS R TR)
W)
(PLUS R TR)
W R)
(WARP X
(PLUS TS W W)
(PLUS R TR)
W R))),
which further simplifies, using linear arithmetic, applying the lemmas
CDR-CONS, PLUS-ASSOCIATES, PLUS-COMMUTES1, and HELPER1, and expanding LST+,
PLUS, SUB1, NUMBERP, EQUAL, and TIMES, to:
T.
Case 25.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (CONS 'Q REST)
(PLUS TS (TIMES K W))
(PLUS R TR)
W R))
(APP (LISTN 3 'Q)
(WARP (CDRN 0 REST)
(PLUS TS W (TIMES K W) (TIMES W 0))
(PLUS TR (TIMES R 3))
W R)))),
which again simplifies, rewriting with LISTN-ADD1, TIMES-COMMUTES1,
PLUS-COMMUTES1, CAR-CONS, and CONS-EQUAL, and opening up the definitions of
EQUAL, LISTN, CONS, CDRN, TIMES, PLUS, CDR, CAR, LISTP, and APP, to the
following two new formulas:
Case 25.2.
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
'Q)).
Appealing to the lemma CAR-CDR-ELIM, we now replace REST by (CONS Z X) to
eliminate (CDR REST) and (CAR REST). The result is:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (SIG (APP (LISTN K FLG1)
(CONS 'Q (CONS Z X)))
TS
(PLUS R TR)
W)
'Q)).
Appealing to the lemma SUB1-ELIM, we now replace K by (ADD1 V) to
eliminate (SUB1 K) and V by (ADD1 D) to eliminate (SUB1 V). We employ the
type restriction lemma noted when SUB1 was introduced to constrain the new
variable. We must thus prove three new formulas:
Case 25.2.3.
(IMPLIES (AND (EQUAL K 0)
(NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (SIG (APP (LISTN K FLG1)
(CONS 'Q (CONS Z X)))
TS
(PLUS R TR)
W)
'Q)),
which further simplifies, using linear arithmetic, to:
T.
Case 25.2.2.
(IMPLIES (AND (EQUAL V 0)
(NUMBERP V)
(NOT (EQUAL (ADD1 V) 0))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 V) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES (ADD1 V) W)))
(LESSP (PLUS R R TR)
(PLUS TS W (TIMES (ADD1 V) W)))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES (ADD1 V) W))))
(EQUAL (SIG (APP (LISTN (ADD1 V) FLG1)
(CONS 'Q (CONS Z X)))
TS
(PLUS R TR)
W)
'Q)),
which further simplifies, using linear arithmetic, to:
T.
Case 25.2.1.
(IMPLIES (AND (NUMBERP D)
(NOT (EQUAL (ADD1 D) 0))
(NOT (EQUAL (ADD1 (ADD1 D)) 0))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL D 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES (ADD1 (ADD1 D)) W)))
(LESSP (PLUS R R TR)
(PLUS TS W (TIMES (ADD1 (ADD1 D)) W)))
(LESSP (PLUS R R TR)
(PLUS TS W W
(TIMES (ADD1 (ADD1 D)) W))))
(EQUAL (SIG (APP (LISTN (ADD1 (ADD1 D)) FLG1)
(CONS 'Q (CONS Z X)))
TS
(PLUS R TR)
W)
'Q)),
which further simplifies, using linear arithmetic, to:
T.
Case 25.1.
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (WARP (CONS 'Q REST)
(PLUS TS (TIMES K W))
(PLUS R TR)
W R)
(CONS 'Q
(CONS 'Q
(WARP REST
(PLUS TS W (TIMES K W))
(PLUS TR (TIMES 3 R))
W R))))).
Applying the lemma CAR-CDR-ELIM, replace REST by (CONS Z X) to eliminate
(CDR REST) and (CAR REST). We would thus like to prove the new formula:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (WARP (CONS 'Q (CONS Z X))
(PLUS TS (TIMES K W))
(PLUS R TR)
W R)
(CONS 'Q
(CONS 'Q
(WARP (CONS Z X)
(PLUS TS W (TIMES K W))
(PLUS TR (TIMES 3 R))
W R))))).
Applying the lemma SUB1-ELIM, replace K by (ADD1 V) to eliminate (SUB1 K)
and V by (ADD1 D) to eliminate (SUB1 V). We rely upon the type
restriction lemma noted when SUB1 was introduced to restrict the new
variable. We thus obtain the following three new conjectures:
Case 25.1.3.
(IMPLIES (AND (EQUAL K 0)
(NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (WARP (CONS 'Q (CONS Z X))
(PLUS TS (TIMES K W))
(PLUS R TR)
W R)
(CONS 'Q
(CONS 'Q
(WARP (CONS Z X)
(PLUS TS W (TIMES K W))
(PLUS TR (TIMES 3 R))
W R))))).
But this further simplifies, using linear arithmetic, to:
T.
Case 25.1.2.
(IMPLIES (AND (EQUAL V 0)
(NUMBERP V)
(NOT (EQUAL (ADD1 V) 0))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 V) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES (ADD1 V) W)))
(LESSP (PLUS R R TR)
(PLUS TS W (TIMES (ADD1 V) W)))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES (ADD1 V) W))))
(EQUAL (WARP (CONS 'Q (CONS Z X))
(PLUS TS (TIMES (ADD1 V) W))
(PLUS R TR)
W R)
(CONS 'Q
(CONS 'Q
(WARP (CONS Z X)
(PLUS TS W (TIMES (ADD1 V) W))
(PLUS TR (TIMES 3 R))
W R))))),
which further simplifies, using linear arithmetic, to:
T.
Case 25.1.1.
(IMPLIES
(AND (NUMBERP D)
(NOT (EQUAL (ADD1 D) 0))
(NOT (EQUAL (ADD1 (ADD1 D)) 0))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL D 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES (ADD1 (ADD1 D)) W)))
(LESSP (PLUS R R TR)
(PLUS TS W (TIMES (ADD1 (ADD1 D)) W)))
(LESSP (PLUS R R TR)
(PLUS TS W W
(TIMES (ADD1 (ADD1 D)) W))))
(EQUAL (WARP (CONS 'Q (CONS Z X))
(PLUS TS (TIMES (ADD1 (ADD1 D)) W))
(PLUS R TR)
W R)
(CONS 'Q
(CONS 'Q
(WARP (CONS Z X)
(PLUS TS W (TIMES (ADD1 (ADD1 D)) W))
(PLUS TR (TIMES 3 R))
W R))))),
which further simplifies, using linear arithmetic, to:
T.
Case 24.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W)))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (CONS 'Q REST)
(PLUS TS (TIMES K W))
(PLUS R TR)
W R))
(APP (LISTN 3 'Q)
(WARP (CDRN 1 REST)
(PLUS TS W (TIMES K W) (TIMES W 1))
(PLUS TR (TIMES R 3))
W R)))),
which again simplifies, using linear arithmetic, to:
T.
Case 23.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W))))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (CONS 'Q REST)
(PLUS TS (TIMES K W))
(PLUS R TR)
W R))
(APP (LISTN 2 'Q)
(WARP (CDRN 0 REST)
(PLUS TS W (TIMES K W) (TIMES W 0))
(PLUS TR (TIMES R 2))
W R)))),
which again simplifies, using linear arithmetic, applying PLUS-COMMUTES1,
PLUS-COMMUTES2, HELPER5, LISTN-ADD1, TIMES-COMMUTES1, CAR-CONS, and
CONS-EQUAL, and expanding PLUS, SUB1, NUMBERP, EQUAL, TIMES, LISTN, CONS,
CDRN, CDR, CAR, LISTP, and APP, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W))))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
'Q)).
Applying the lemma CAR-CDR-ELIM, replace REST by (CONS Z X) to eliminate
(CDR REST) and (CAR REST). We thus obtain:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W))))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (SIG (APP (LISTN K FLG1)
(CONS 'Q (CONS Z X)))
TS
(PLUS R TR)
W)
'Q)).
Applying the lemma SUB1-ELIM, replace K by (ADD1 V) to eliminate (SUB1 K)
and V by (ADD1 D) to eliminate (SUB1 V). We use the type restriction lemma
noted when SUB1 was introduced to restrict the new variable. We would thus
like to prove the following three new conjectures:
Case 23.3.
(IMPLIES (AND (EQUAL K 0)
(NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W))))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (SIG (APP (LISTN K FLG1)
(CONS 'Q (CONS Z X)))
TS
(PLUS R TR)
W)
'Q)).
But this further simplifies, using linear arithmetic, to:
T.
Case 23.2.
(IMPLIES (AND (EQUAL V 0)
(NUMBERP V)
(NOT (EQUAL (ADD1 V) 0))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 V) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES (ADD1 V) W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W (TIMES (ADD1 V) W))))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES (ADD1 V) W))))
(EQUAL (SIG (APP (LISTN (ADD1 V) FLG1)
(CONS 'Q (CONS Z X)))
TS
(PLUS R TR)
W)
'Q)),
which further simplifies, using linear arithmetic, to:
T.
Case 23.1.
(IMPLIES (AND (NUMBERP D)
(NOT (EQUAL (ADD1 D) 0))
(NOT (EQUAL (ADD1 (ADD1 D)) 0))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL D 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES (ADD1 (ADD1 D)) W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W
(TIMES (ADD1 (ADD1 D)) W))))
(LESSP (PLUS R R TR)
(PLUS TS W W
(TIMES (ADD1 (ADD1 D)) W))))
(EQUAL (SIG (APP (LISTN (ADD1 (ADD1 D)) FLG1)
(CONS 'Q (CONS Z X)))
TS
(PLUS R TR)
W)
'Q)),
which further simplifies, applying LISTN-ADD1, CDR-CONS, CAR-CONS, and
PLUS-ASSOCIATES, and opening up the definitions of NUMBERP, EQUAL, LISTN,
APP, LISTP, RECONCILE-SIGNALS, and SIG, to:
T.
Case 22.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W))))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W)))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (CONS 'Q REST)
(PLUS TS (TIMES K W))
(PLUS R TR)
W R))
(APP (LISTN 2 'Q)
(WARP (CDRN 1 REST)
(PLUS TS W (TIMES K W) (TIMES W 1))
(PLUS TR (TIMES R 2))
W R)))).
This again simplifies, using linear arithmetic, applying PLUS-COMMUTES2,
PLUS-ASSOCIATES, PLUS-COMMUTES1, HELPER8, LISTN-ADD1, TIMES-COMMUTES1,
CAR-CONS, and CONS-EQUAL, and unfolding PLUS, SUB1, NUMBERP, EQUAL, TIMES,
LISTN, CONS, CDRN, CDR, CAR, LISTP, and APP, to the new goal:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W))))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W)))))
(EQUAL (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
'Q)).
Applying the lemma CAR-CDR-ELIM, replace REST by (CONS Z X) to eliminate
(CDR REST) and (CAR REST). This produces:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W))))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W)))))
(EQUAL (SIG (APP (LISTN K FLG1)
(CONS 'Q (CONS Z X)))
TS
(PLUS R TR)
W)
'Q)).
Applying the lemma SUB1-ELIM, replace K by (ADD1 V) to eliminate (SUB1 K)
and V by (ADD1 D) to eliminate (SUB1 V). We rely upon the type restriction
lemma noted when SUB1 was introduced to restrict the new variable. We thus
obtain the following three new goals:
Case 22.3.
(IMPLIES (AND (EQUAL K 0)
(NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 (SUB1 K)) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W))))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W)))))
(EQUAL (SIG (APP (LISTN K FLG1)
(CONS 'Q (CONS Z X)))
TS
(PLUS R TR)
W)
'Q)).
This further simplifies, using linear arithmetic, to:
T.
Case 22.2.
(IMPLIES (AND (EQUAL V 0)
(NUMBERP V)
(NOT (EQUAL (ADD1 V) 0))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL (SUB1 V) 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES (ADD1 V) W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W (TIMES (ADD1 V) W))))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W W (TIMES (ADD1 V) W)))))
(EQUAL (SIG (APP (LISTN (ADD1 V) FLG1)
(CONS 'Q (CONS Z X)))
TS
(PLUS R TR)
W)
'Q)),
which further simplifies, using linear arithmetic, to:
T.
Case 22.1.
(IMPLIES (AND (NUMBERP D)
(NOT (EQUAL (ADD1 D) 0))
(NOT (EQUAL (ADD1 (ADD1 D)) 0))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP X)
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(EQUAL D 0)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES (ADD1 (ADD1 D)) W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W
(TIMES (ADD1 (ADD1 D)) W))))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W W
(TIMES (ADD1 (ADD1 D)) W)))))
(EQUAL (SIG (APP (LISTN (ADD1 (ADD1 D)) FLG1)
(CONS 'Q (CONS Z X)))
TS
(PLUS R TR)
W)
'Q)),
which further simplifies, applying LISTN-ADD1, CDR-CONS, CAR-CONS, and
PLUS-ASSOCIATES, and opening up the definitions of NUMBERP, EQUAL, LISTN,
APP, LISTP, RECONCILE-SIGNALS, and SIG, to:
T.
Case 21.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(LESSP (PLUS TS W W W) (PLUS R TR))
(NENDP (SUB1 (SUB1 (SUB1 K)))
(PLUS TS W W W)
(PLUS R TR)
W)
(NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES K W))))
(LESSP (PLUS R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (LST+ REST
(PLUS TS W (TIMES K W))
(PLUS R TR)
W)
(PLUS TS W (TIMES K W))
(PLUS R TR)
W R))
(APP (LISTN 1 'Q)
(WARP (CDRN 0 REST)
(PLUS TS W (TIMES K W) (TIMES W 0))
(PLUS TR (TIMES R 1))
W R)))).
This again simplifies, using linear arithmetic, to:
T.
Case 20.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(LESSP (PLUS TS W W W) (PLUS R TR))
(NENDP (SUB1 (SUB1 (SUB1 K)))
(PLUS TS W W W)
(PLUS R TR)
W)
(NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES K W))))
(EQUAL (PLUS R TR)
(PLUS TS W (TIMES K W)))
(NOT (LESSP (PLUS R TR)
(PLUS TS W W (TIMES K W)))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (LST+ REST
(PLUS TS W (TIMES K W))
(PLUS R TR)
W)
(NTS+ (LEN (CDR REST))
(PLUS TS W W (TIMES K W))
(PLUS R TR)
W)
(PLUS R TR)
W R))
(APP (LISTN 1 'Q)
(WARP (CDRN 0 REST)
(PLUS TS W (TIMES K W) (TIMES W 0))
(PLUS TR (TIMES R 1))
W R)))),
which again simplifies, using linear arithmetic, to:
T.
Case 19.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(LESSP (PLUS TS W W W) (PLUS R TR))
(NENDP (SUB1 (SUB1 (SUB1 K)))
(PLUS TS W W W)
(PLUS R TR)
W)
(NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES K W))))
(NOT (EQUAL (PLUS R TR)
(PLUS TS W (TIMES K W))))
(NOT (LESSP (PLUS R TR)
(PLUS TS W W (TIMES K W)))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (LST+ REST
(PLUS TS W (TIMES K W))
(PLUS R TR)
W)
(NTS+ (LEN (CDR REST))
(PLUS TS W W (TIMES K W))
(PLUS R TR)
W)
(PLUS R TR)
W R))
(APP (LISTN 1 'Q)
(WARP (CDRN 1 REST)
(PLUS TS W (TIMES K W) (TIMES W 1))
(PLUS TR (TIMES R 1))
W R)))),
which again simplifies, using linear arithmetic, to:
T.
Case 18.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(LESSP (PLUS TS W W W) (PLUS R TR))
(NENDP (SUB1 (SUB1 (SUB1 K)))
(PLUS TS W W W)
(PLUS R TR)
W)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (CONS 'Q REST)
(PLUS TS (TIMES K W))
(PLUS R TR)
W R))
(APP (LISTN 3 'Q)
(WARP (CDRN 0 REST)
(PLUS TS W (TIMES K W) (TIMES W 0))
(PLUS TR (TIMES R 3))
W R)))),
which again simplifies, using linear arithmetic, to:
T.
Case 17.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(LESSP (PLUS TS W W W) (PLUS R TR))
(NENDP (SUB1 (SUB1 (SUB1 K)))
(PLUS TS W W W)
(PLUS R TR)
W)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W)))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (CONS 'Q REST)
(PLUS TS (TIMES K W))
(PLUS R TR)
W R))
(APP (LISTN 3 'Q)
(WARP (CDRN 1 REST)
(PLUS TS W (TIMES K W) (TIMES W 1))
(PLUS TR (TIMES R 3))
W R)))),
which again simplifies, using linear arithmetic, to:
T.
Case 16.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(LESSP (PLUS TS W W W) (PLUS R TR))
(NENDP (SUB1 (SUB1 (SUB1 K)))
(PLUS TS W W W)
(PLUS R TR)
W)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W))))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (CONS 'Q REST)
(PLUS TS (TIMES K W))
(PLUS R TR)
W R))
(APP (LISTN 2 'Q)
(WARP (CDRN 0 REST)
(PLUS TS W (TIMES K W) (TIMES W 0))
(PLUS TR (TIMES R 2))
W R)))),
which again simplifies, using linear arithmetic, to:
T.
Case 15.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(LESSP (PLUS TS W W) (PLUS R TR))
(LESSP (PLUS TS W W W) (PLUS R TR))
(NENDP (SUB1 (SUB1 (SUB1 K)))
(PLUS TS W W W)
(PLUS R TR)
W)
(LESSP (PLUS R TR)
(PLUS TS W (TIMES K W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W (TIMES K W))))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W W (TIMES K W)))))
(EQUAL (CONS (SIG (APP (LISTN K FLG1) (CONS 'Q REST))
TS
(PLUS R TR)
W)
(WARP (CONS 'Q REST)
(PLUS TS (TIMES K W))
(PLUS R TR)
W R))
(APP (LISTN 2 'Q)
(WARP (CDRN 1 REST)
(PLUS TS W (TIMES K W) (TIMES W 1))
(PLUS TR (TIMES R 2))
W R)))),
which again simplifies, using linear arithmetic, to:
T.
Case 14.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(EQUAL (SUB1 K) 0)
(EQUAL K 0)
(NOT (LESSP (PLUS R TR) (PLUS TS W 0)))
(LESSP (PLUS R TR) (PLUS TS W W 0)))
(EQUAL (WARP (APP NIL (CONS 'Q REST))
TS TR W R)
(APP (LISTN 1 'Q)
(WARP (CDRN 0 REST)
(PLUS TS W 0 (TIMES W 0))
(PLUS TR (TIMES R 1))
W R)))),
which again simplifies, rewriting with PLUS-COMMUTES1, HELPER14, LISTN-ADD1,
and TIMES-COMMUTES1, and expanding NUMBERP, SUB1, EQUAL, PLUS, LISTP, APP,
LISTN, CONS, CDRN, TIMES, CDR, and CAR, to:
T.
Case 13.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(EQUAL (SUB1 K) 0)
(EQUAL K 0)
(NOT (LESSP (PLUS R TR) (PLUS TS W 0)))
(EQUAL (PLUS R TR) (PLUS TS W 0)))
(EQUAL (WARP (APP NIL (CONS 'Q REST))
TS TR W R)
(APP (LISTN 1 'Q)
(WARP (CDRN 0 REST)
(PLUS TS W 0 (TIMES W 0))
(PLUS TR (TIMES R 1))
W R)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 12.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(EQUAL (SUB1 K) 0)
(EQUAL K 0)
(NOT (LESSP (PLUS R TR) (PLUS TS W 0)))
(NOT (EQUAL (PLUS R TR) (PLUS TS W 0)))
(NOT (LESSP (PLUS R TR) (PLUS TS W W 0))))
(EQUAL (WARP (APP NIL (CONS 'Q REST))
TS TR W R)
(APP (LISTN 1 'Q)
(WARP (CDRN 1 REST)
(PLUS TS W 0 (TIMES W 1))
(PLUS TR (TIMES R 1))
W R)))),
which again simplifies, using linear arithmetic, rewriting with
PLUS-COMMUTES1, HELPER8, LISTN-ADD1, and TIMES-COMMUTES1, and expanding the
definitions of NUMBERP, SUB1, EQUAL, PLUS, LISTP, APP, TIMES, LISTN, CONS,
CDRN, CDR, and CAR, to:
T.
Case 11.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(EQUAL (SUB1 K) 0)
(EQUAL K 0)
(LESSP (PLUS R TR) (PLUS TS W 0))
(LESSP (PLUS R R TR) (PLUS TS W 0))
(LESSP (PLUS R R TR) (PLUS TS W W 0)))
(EQUAL (WARP (APP NIL (CONS 'Q REST))
TS TR W R)
(APP (LISTN 3 'Q)
(WARP (CDRN 0 REST)
(PLUS TS W 0 (TIMES W 0))
(PLUS TR (TIMES R 3))
W R)))).
But this again simplifies, using linear arithmetic, to:
T.
Case 10.(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(EQUAL (SUB1 K) 0)
(EQUAL K 0)
(LESSP (PLUS R TR) (PLUS TS W 0))
(LESSP (PLUS R R TR) (PLUS TS W 0))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W W 0))))
(EQUAL (WARP (APP NIL (CONS 'Q REST))
TS TR W R)
(APP (LISTN 3 'Q)
(WARP (CDRN 1 REST)
(PLUS TS W 0 (TIMES W 1))
(PLUS TR (TIMES R 3))
W R)))),
which again simplifies, using linear arithmetic, to:
T.
Case 9. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(EQUAL (SUB1 K) 0)
(EQUAL K 0)
(LESSP (PLUS R TR) (PLUS TS W 0))
(NOT (LESSP (PLUS R R TR) (PLUS TS W 0)))
(LESSP (PLUS R R TR) (PLUS TS W W 0)))
(EQUAL (WARP (APP NIL (CONS 'Q REST))
TS TR W R)
(APP (LISTN 2 'Q)
(WARP (CDRN 0 REST)
(PLUS TS W 0 (TIMES W 0))
(PLUS TR (TIMES R 2))
W R)))),
which again simplifies, using linear arithmetic, to:
T.
Case 8. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(EQUAL (SUB1 K) 0)
(EQUAL K 0)
(LESSP (PLUS R TR) (PLUS TS W 0))
(NOT (LESSP (PLUS R R TR) (PLUS TS W 0)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W W 0))))
(EQUAL (WARP (APP NIL (CONS 'Q REST))
TS TR W R)
(APP (LISTN 2 'Q)
(WARP (CDRN 1 REST)
(PLUS TS W 0 (TIMES W 1))
(PLUS TR (TIMES R 2))
W R)))),
which again simplifies, using linear arithmetic, to:
T.
Case 7. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(EQUAL (SUB1 K) 0)
(NOT (EQUAL K 0))
(NOT (LESSP (PLUS R TR) (PLUS TS W W)))
(LESSP (PLUS R TR) (PLUS TS W W W)))
(EQUAL (WARP (APP (LIST FLG1) (CONS 'Q REST))
TS TR W R)
(APP (LISTN 1 'Q)
(WARP (CDRN 0 REST)
(PLUS TS W W (TIMES W 0))
(PLUS TR (TIMES R 1))
W R)))),
which again simplifies, using linear arithmetic, rewriting with CDR-CONS,
CAR-CONS, PLUS-COMMUTES1, HELPER7, LISTN-ADD1, and TIMES-COMMUTES1, and
opening up the definitions of APP, LISTP, PLUS, SUB1, NUMBERP, EQUAL, TIMES,
LISTN, CONS, CDRN, CDR, and CAR, to:
T.
Case 6. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(EQUAL (SUB1 K) 0)
(NOT (EQUAL K 0))
(NOT (LESSP (PLUS R TR) (PLUS TS W W)))
(EQUAL (PLUS R TR) (PLUS TS W W)))
(EQUAL (WARP (APP (LIST FLG1) (CONS 'Q REST))
TS TR W R)
(APP (LISTN 1 'Q)
(WARP (CDRN 0 REST)
(PLUS TS W W (TIMES W 0))
(PLUS TR (TIMES R 1))
W R)))).
However this again simplifies, using linear arithmetic, applying CDR-CONS,
CAR-CONS, PLUS-COMMUTES1, HELPER7, LISTN-ADD1, and TIMES-COMMUTES1, and
opening up the definitions of APP, LISTP, PLUS, SUB1, NUMBERP, EQUAL, TIMES,
LISTN, CONS, CDRN, CDR, and CAR, to:
T.
Case 5. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(EQUAL (SUB1 K) 0)
(NOT (EQUAL K 0))
(NOT (LESSP (PLUS R TR) (PLUS TS W W)))
(NOT (EQUAL (PLUS R TR) (PLUS TS W W)))
(NOT (LESSP (PLUS R TR) (PLUS TS W W W))))
(EQUAL (WARP (APP (LIST FLG1) (CONS 'Q REST))
TS TR W R)
(APP (LISTN 1 'Q)
(WARP (CDRN 1 REST)
(PLUS TS W W (TIMES W 1))
(PLUS TR (TIMES R 1))
W R)))).
This again simplifies, using linear arithmetic, to:
T.
Case 4. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(EQUAL (SUB1 K) 0)
(NOT (EQUAL K 0))
(LESSP (PLUS R TR) (PLUS TS W W))
(LESSP (PLUS R R TR) (PLUS TS W W))
(LESSP (PLUS R R TR) (PLUS TS W W W)))
(EQUAL (WARP (APP (LIST FLG1) (CONS 'Q REST))
TS TR W R)
(APP (LISTN 3 'Q)
(WARP (CDRN 0 REST)
(PLUS TS W W (TIMES W 0))
(PLUS TR (TIMES R 3))
W R)))),
which again simplifies, applying CDR-CONS, CAR-CONS, HELPER11, LISTN-ADD1,
TIMES-COMMUTES1, and PLUS-COMMUTES1, and unfolding the definitions of APP,
LISTP, EQUAL, LISTN, CONS, CDRN, TIMES, PLUS, CDR, and CAR, to:
T.
Case 3. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(EQUAL (SUB1 K) 0)
(NOT (EQUAL K 0))
(LESSP (PLUS R TR) (PLUS TS W W))
(LESSP (PLUS R R TR) (PLUS TS W W))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W W W))))
(EQUAL (WARP (APP (LIST FLG1) (CONS 'Q REST))
TS TR W R)
(APP (LISTN 3 'Q)
(WARP (CDRN 1 REST)
(PLUS TS W W (TIMES W 1))
(PLUS TR (TIMES R 3))
W R)))).
This again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(EQUAL (SUB1 K) 0)
(NOT (EQUAL K 0))
(LESSP (PLUS R TR) (PLUS TS W W))
(NOT (LESSP (PLUS R R TR) (PLUS TS W W)))
(LESSP (PLUS R R TR) (PLUS TS W W W)))
(EQUAL (WARP (APP (LIST FLG1) (CONS 'Q REST))
TS TR W R)
(APP (LISTN 2 'Q)
(WARP (CDRN 0 REST)
(PLUS TS W W (TIMES W 0))
(PLUS TR (TIMES R 2))
W R)))),
which again simplifies, applying the lemmas CDR-CONS, CAR-CONS, HELPER10,
LISTN-ADD1, TIMES-COMMUTES1, PLUS-COMMUTES1, and PLUS-COMMUTES2, and opening
up APP, LISTP, EQUAL, LISTN, CONS, CDRN, TIMES, PLUS, NUMBERP, SUB1, CDR,
and CAR, to:
T.
Case 1. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP K)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (PLUS R R))
(LESSP R (TIMES 2 W))
(LISTP REST)
(LISTP (CDR REST))
(LESSP (PLUS TS W) (PLUS R TR))
(EQUAL (SUB1 K) 0)
(NOT (EQUAL K 0))
(LESSP (PLUS R TR) (PLUS TS W W))
(NOT (LESSP (PLUS R R TR) (PLUS TS W W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W W W))))
(EQUAL (WARP (APP (LIST FLG1) (CONS 'Q REST))
TS TR W R)
(APP (LISTN 2 'Q)
(WARP (CDRN 1 REST)
(PLUS TS W W (TIMES W 1))
(PLUS TR (TIMES R 2))
W R)))),
which again simplifies, applying CDR-CONS, CAR-CONS, HELPER9, LISTN-ADD1,
PLUS-COMMUTES1, TIMES-COMMUTES1, and PLUS-COMMUTES2, and unfolding the
functions APP, LISTP, EQUAL, LISTN, CONS, SUB1, NUMBERP, CDRN, TIMES, PLUS,
CDR, and CAR, to:
T.
Q.E.D.
[ 0.0 1.5 0.1 ]
WARP-APP-ACROSS-GAP
(DISABLE HELPER1)
[ 0.0 0.0 0.0 ]
HELPER1-OFF
(DISABLE HELPER5)
[ 0.0 0.0 0.0 ]
HELPER5-OFF
(DISABLE HELPER7)
[ 0.0 0.0 0.0 ]
HELPER7-OFF
(DISABLE HELPER8)
[ 0.0 0.0 0.0 ]
HELPER8-OFF
(DISABLE HELPER9)
[ 0.0 0.0 0.0 ]
HELPER9-OFF
(DISABLE HELPER10)
[ 0.0 0.0 0.0 ]
HELPER10-OFF
(DISABLE HELPER11)
[ 0.0 0.0 0.0 ]
HELPER11-OFF
(DISABLE HELPER14)
[ 0.0 0.0 0.0 ]
HELPER14-OFF
(DISABLE HELPER15)
[ 0.0 0.0 0.0 ]
HELPER15-OFF
(DISABLE NQG)
[ 0.0 0.0 0.0 ]
NQG-OFF
(DISABLE DWG)
[ 0.0 0.0 0.0 ]
DWG-OFF
(DISABLE TSG)
[ 0.0 0.0 0.0 ]
TSG-OFF
(DISABLE TRG)
[ 0.0 0.0 0.0 ]
TRG-OFF
(DEFN NQ
(N TS TR W R)
(NQG (NLST* N TS TR W R)
(NTS* N TS TR W R)
(NTR* N TS TR W R)
W R))
Note that (NUMBERP (NQ N TS TR W R)) is a theorem.
[ 0.0 0.0 0.0 ]
NQ
(DEFN DW
(N TS TR W R)
(DWG (NLST* N TS TR W R)
(NTS* N TS TR W R)
(NTR* N TS TR W R)
W R))
Note that (NUMBERP (DW N TS TR W R)) is a theorem.
[ 0.0 0.0 0.0 ]
DW
(DEFN TS
(N TS TR W R)
(TSG (NLST* N TS TR W R)
(NTS* N TS TR W R)
(NTR* N TS TR W R)
W R))
Note that (NUMBERP (TS N TS TR W R)) is a theorem.
[ 0.0 0.0 0.0 ]
TS
(DEFN TR
(N TS TR W R)
(TRG (NLST* N TS TR W R)
(NTS* N TS TR W R)
(NTR* N TS TR W R)
W R))
Note that (NUMBERP (TR N TS TR W R)) is a theorem.
[ 0.0 0.0 0.0 ]
TR
(PROVE-LEMMA LESSP-2-LEN-IMPLIES-LISTPS NIL
(IMPLIES (LESSP 2 (LEN X))
(AND (LISTP X) (LISTP (CDR X)))))
This conjecture simplifies, applying CDR-NLISTP, and expanding the functions
LEN, LISTP, and AND, to two new conjectures:
Case 2. (IMPLIES (NOT (LISTP X))
(NOT (LESSP 2 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (LISTP X)
(LESSP 2 (ADD1 (LEN (CDR X)))))
(LISTP (CDR X))),
which again simplifies, unfolding the functions LEN, ADD1, and LESSP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-2-LEN-IMPLIES-LISTPS
(PROVE-LEMMA WARP-APP-LISTN-Q1 NIL
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NUMBERP N1)
(LESSP 2 (LEN REST)))
(EQUAL (TARGET (WARP (APP (LISTN N1 FLG1) (CONS 'Q REST))
TS TR W R))
(APP (LISTN (N* N1 TS TR W R) FLG1)
(APP (LISTN (NQ N1 TS TR W R) 'Q)
(WARP (CDRN (DW N1 TS TR W R) REST)
(TS N1 TS TR W R)
(TR N1 TS TR W R)
W R)))))
((USE (LESSP-2-LEN-IMPLIES-LISTPS (X REST)))
(DISABLE WARP-APP-GAP)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to the goal:
(IMPLIES (AND (IMPLIES (LESSP 2 (LEN REST))
(AND (LISTP REST) (LISTP (CDR REST))))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NUMBERP N1)
(LESSP 2 (LEN REST)))
(EQUAL (TARGET (WARP (APP (LISTN N1 FLG1) (CONS 'Q REST))
TS TR W R))
(APP (LISTN (N* N1 TS TR W R) FLG1)
(APP (LISTN (NQ N1 TS TR W R) 'Q)
(WARP (CDRN (DW N1 TS TR W R) REST)
(TS N1 TS TR W R)
(TR N1 TS TR W R)
W R))))).
This simplifies, using linear arithmetic, rewriting with the lemmas SUB1-ADD1,
WARP-LISTN, LST*-LISTN, LEN-LISTN, LEN-TS*, LEN-TR*, WARP-APP,
APP-CANCELLATION, NENDP-NLST*, LESSP-NTR*-NTS*, PLUS-COMMUTES1,
NOT-LESSP-NTR*-NTS*, and WARP-APP-ACROSS-GAP, and expanding the definitions of
LEN, AND, IMPLIES, LESSP, SUB1, NUMBERP, EQUAL, NQ, DW, TS, and TR, to:
(IMPLIES (AND (LISTP REST)
(NOT (LESSP 2 (ADD1 (LEN (CDR REST)))))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NUMBERP N1)
(LESSP 1 (LEN (CDR REST))))
(EQUAL (WARP (APP (LISTN (NLST* N1 TS TR W R) FLG1)
(CONS 'Q REST))
(NTS* N1 TS TR W R)
(NTR* N1 TS TR W R)
W R)
(APP (LISTN (NQG (NLST* N1 TS TR W R)
(NTS* N1 TS TR W R)
(NTR* N1 TS TR W R)
W R)
'Q)
(WARP (CDRN (DWG (NLST* N1 TS TR W R)
(NTS* N1 TS TR W R)
(NTR* N1 TS TR W R)
W R)
REST)
(TSG (NLST* N1 TS TR W R)
(NTS* N1 TS TR W R)
(NTR* N1 TS TR W R)
W R)
(TRG (NLST* N1 TS TR W R)
(NTS* N1 TS TR W R)
(NTR* N1 TS TR W R)
W R)
W R)))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
WARP-APP-LISTN-Q1
(PROVE-LEMMA WARP-APP-LISTN-Q
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NUMBERP N1)
(LESSP 2 (LEN REST)))
(EQUAL (WARP (APP (LISTN N1 FLG1) (CONS 'Q REST))
TS TR W R)
(APP (LISTN (N* N1 TS TR W R) FLG1)
(APP (LISTN (NQ N1 TS TR W R) 'Q)
(WARP (CDRN (DW N1 TS TR W R) REST)
(TS N1 TS TR W R)
(TR N1 TS TR W R)
W R)))))
((USE (WARP-APP-LISTN-Q1))
(ENABLE TARGET)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
IMPLIES, and TARGET, to:
(IMPLIES
(AND (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NUMBERP N1)
(LESSP 2 (LEN REST)))
(EQUAL (WARP (APP (LISTN N1 FLG1) (CONS 'Q REST))
TS TR W R)
(APP (LISTN (N* N1 TS TR W R) FLG1)
(APP (LISTN (NQ N1 TS TR W R) 'Q)
(WARP (CDRN (DW N1 TS TR W R) REST)
(TS N1 TS TR W R)
(TR N1 TS TR W R)
W R)))))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NUMBERP N1)
(LESSP 2 (LEN REST)))
(EQUAL (WARP (APP (LISTN N1 FLG1) (CONS 'Q REST))
TS TR W R)
(APP (LISTN (N* N1 TS TR W R) FLG1)
(APP (LISTN (NQ N1 TS TR W R) 'Q)
(WARP (CDRN (DW N1 TS TR W R) REST)
(TS N1 TS TR W R)
(TR N1 TS TR W R)
W R))))).
This simplifies, expanding the functions ZEROP, NOT, AND, NQ, DW, TS, TR, and
IMPLIES, to:
T.
Q.E.D.
[ 0.0 0.2 0.0 ]
WARP-APP-LISTN-Q
(DISABLE LISTN-ADD1)
[ 0.0 0.0 0.0 ]
LISTN-ADD1-OFF
(DISABLE WARP-APP-ACROSS-GAP)
[ 0.0 0.0 0.0 ]
WARP-APP-ACROSS-GAP-OFF
(DISABLE WARP-APP-GAP)
[ 0.0 0.0 0.0 ]
WARP-APP-GAP-OFF
(DISABLE WARP-LISTN)
[ 0.0 0.0 0.0 ]
WARP-LISTN-OFF
(DISABLE WARP-APP)
[ 0.0 0.0 0.0 ]
WARP-APP-OFF
(PROVE-LEMMA SMOOTH-CONGRUENCE
(REWRITE)
(IMPLIES (NOT (B-XOR FLG1 FLG2))
(EQUAL (EQUAL (SMOOTH FLG2 REST)
(SMOOTH FLG1 REST))
T))
((ENABLE B-XOR SMOOTH)))
This conjecture simplifies, unfolding the definitions of B-XOR and EQUAL, to:
(IMPLIES (AND FLG1 FLG2)
(EQUAL (SMOOTH FLG2 REST)
(SMOOTH FLG1 REST))).
Give the above formula the name *1.
We will appeal to 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 (NLISTP REST)
(p FLG2 REST FLG1))
(IMPLIES (AND (NOT (NLISTP REST))
(B-XOR FLG2 (CAR REST))
(p (CAR REST) (CDR REST) (CAR REST)))
(p FLG2 REST FLG1))
(IMPLIES (AND (NOT (NLISTP REST))
(NOT (B-XOR FLG2 (CAR REST)))
(p (CAR REST) (CDR REST) (CAR REST)))
(p FLG2 REST FLG1))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP inform us that the measure (COUNT REST) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instances chosen for FLG1 and FLG2. The above
induction scheme produces the following five new formulas:
Case 5. (IMPLIES (AND (NLISTP REST) FLG1 FLG2)
(EQUAL (SMOOTH FLG2 REST)
(SMOOTH FLG1 REST))).
This simplifies, unfolding the definitions of NLISTP, SMOOTH, and EQUAL, to:
T.
Case 4. (IMPLIES (AND (NOT (NLISTP REST))
(B-XOR FLG2 (CAR REST))
(NOT (CAR REST))
FLG1 FLG2)
(EQUAL (SMOOTH FLG2 REST)
(SMOOTH FLG1 REST))).
This simplifies, expanding the definitions of NLISTP, B-XOR, and SMOOTH, to:
T.
Case 3. (IMPLIES (AND (NOT (NLISTP REST))
(B-XOR FLG2 (CAR REST))
(EQUAL (SMOOTH (CAR REST) (CDR REST))
(SMOOTH (CAR REST) (CDR REST)))
FLG1 FLG2)
(EQUAL (SMOOTH FLG2 REST)
(SMOOTH FLG1 REST))).
This simplifies, unfolding NLISTP, B-XOR, and SMOOTH, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP REST))
(NOT (B-XOR FLG2 (CAR REST)))
(NOT (CAR REST))
FLG1 FLG2)
(EQUAL (SMOOTH FLG2 REST)
(SMOOTH FLG1 REST))).
This simplifies, expanding NLISTP and B-XOR, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP REST))
(NOT (B-XOR FLG2 (CAR REST)))
(EQUAL (SMOOTH (CAR REST) (CDR REST))
(SMOOTH (CAR REST) (CDR REST)))
FLG1 FLG2)
(EQUAL (SMOOTH FLG2 REST)
(SMOOTH FLG1 REST))).
This simplifies, unfolding the definitions of NLISTP, B-XOR, and SMOOTH, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
SMOOTH-CONGRUENCE
(PROVE-LEMMA SMOOTH-FLG-APP-LISTN-FLG
(REWRITE)
(IMPLIES (NOT (B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG1
(APP (LISTN P1 FLG2) REST))
(APP (LISTN P1 FLG2)
(SMOOTH FLG1 REST))))
((INDUCT (LISTN P1 FLG2))
(ENABLE SMOOTH LISTN)))
This formula can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to the following two new goals:
Case 2. (IMPLIES (AND (ZEROP P1)
(NOT (B-XOR FLG1 FLG2)))
(EQUAL (SMOOTH FLG1
(APP (LISTN P1 FLG2) REST))
(APP (LISTN P1 FLG2)
(SMOOTH FLG1 REST)))).
This simplifies, opening up ZEROP, EQUAL, LISTN, LISTP, and APP, to:
T.
Case 1. (IMPLIES
(AND (NOT (EQUAL P1 0))
(NUMBERP P1)
(IMPLIES (NOT (B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG1
(APP (LISTN (SUB1 P1) FLG2) REST))
(APP (LISTN (SUB1 P1) FLG2)
(SMOOTH FLG1 REST))))
(NOT (B-XOR FLG1 FLG2)))
(EQUAL (SMOOTH FLG1
(APP (LISTN P1 FLG2) REST))
(APP (LISTN P1 FLG2)
(SMOOTH FLG1 REST)))).
This simplifies, rewriting with the lemmas CDR-CONS, CAR-CONS, and
CONS-EQUAL, and expanding the definitions of NOT, IMPLIES, LISTN, APP, and
SMOOTH, to:
(IMPLIES (AND (NOT (EQUAL P1 0))
(NUMBERP P1)
(EQUAL (SMOOTH FLG1
(APP (LISTN (SUB1 P1) FLG2) REST))
(APP (LISTN (SUB1 P1) FLG2)
(SMOOTH FLG1 REST)))
(NOT (B-XOR FLG1 FLG2)))
(EQUAL (SMOOTH FLG2
(APP (LISTN (SUB1 P1) FLG2) REST))
(APP (LISTN (SUB1 P1) FLG2)
(SMOOTH FLG1 REST)))).
Applying the lemma SUB1-ELIM, replace P1 by (ADD1 X) to eliminate (SUB1 P1).
We employ the type restriction lemma noted when SUB1 was introduced to
restrict the new variable. We would thus like to prove:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (ADD1 X) 0))
(EQUAL (SMOOTH FLG1
(APP (LISTN X FLG2) REST))
(APP (LISTN X FLG2)
(SMOOTH FLG1 REST)))
(NOT (B-XOR FLG1 FLG2)))
(EQUAL (SMOOTH FLG2
(APP (LISTN X FLG2) REST))
(APP (LISTN X FLG2)
(SMOOTH FLG1 REST)))),
which further simplifies, obviously, to:
(IMPLIES (AND (NUMBERP X)
(EQUAL (SMOOTH FLG1
(APP (LISTN X FLG2) REST))
(APP (LISTN X FLG2)
(SMOOTH FLG1 REST)))
(NOT (B-XOR FLG1 FLG2)))
(EQUAL (SMOOTH FLG2
(APP (LISTN X FLG2) REST))
(APP (LISTN X FLG2)
(SMOOTH FLG1 REST)))).
We now use the above equality hypothesis by substituting:
(SMOOTH FLG1
(APP (LISTN X FLG2) REST))
for (APP (LISTN X FLG2) (SMOOTH FLG1 REST)) and throwing away the equality.
The result is the goal:
(IMPLIES (AND (NUMBERP X)
(NOT (B-XOR FLG1 FLG2)))
(EQUAL (SMOOTH FLG2
(APP (LISTN X FLG2) REST))
(SMOOTH FLG1
(APP (LISTN X FLG2) REST)))).
However this further simplifies, applying SMOOTH-CONGRUENCE, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
SMOOTH-FLG-APP-LISTN-FLG
(PROVE-LEMMA LISTP-APP-LISTN
(REWRITE)
(EQUAL (LISTP (APP (LISTN N FLG) REST))
(OR (NOT (ZEROP N)) (LISTP REST)))
((ENABLE LISTN)))
This formula simplifies, expanding ZEROP, NOT, and OR, to three new
conjectures:
Case 3. (IMPLIES (NOT (NUMBERP N))
(EQUAL (LISTP (APP (LISTN N FLG) REST))
(LISTP REST))),
which again simplifies, expanding the definitions of LISTN, LISTP, and APP,
to:
T.
Case 2. (IMPLIES (EQUAL N 0)
(EQUAL (LISTP (APP (LISTN N FLG) REST))
(LISTP REST))),
which again simplifies, opening up the definitions of EQUAL, LISTN, LISTP,
and APP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL N 0)) (NUMBERP N))
(EQUAL (LISTP (APP (LISTN N FLG) REST))
T)),
which again simplifies, trivially, to:
(IMPLIES (AND (NOT (EQUAL N 0)) (NUMBERP N))
(LISTP (APP (LISTN N FLG) REST))),
which we will name *1.
Perhaps we can prove it by induction. There is only one plausible
induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP N) (p N FLG REST))
(IMPLIES (AND (NOT (ZEROP N))
(p (SUB1 N) FLG REST))
(p N FLG REST))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT N) decreases according to the well-founded relation
LESSP in each induction step of the scheme. The above induction scheme
generates the following three new formulas:
Case 3. (IMPLIES (AND (ZEROP N)
(NOT (EQUAL N 0))
(NUMBERP N))
(LISTP (APP (LISTN N FLG) REST))).
This simplifies, opening up the function ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (SUB1 N) 0)
(NOT (EQUAL N 0))
(NUMBERP N))
(LISTP (APP (LISTN N FLG) REST))).
This simplifies, rewriting with CDR-CONS and CAR-CONS, and unfolding the
functions ZEROP, LISTN, and APP, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(LISTP (APP (LISTN (SUB1 N) FLG) REST))
(NOT (EQUAL N 0))
(NUMBERP N))
(LISTP (APP (LISTN N FLG) REST))),
which simplifies, rewriting with CDR-CONS and CAR-CONS, and opening up the
definitions of ZEROP, LISTN, and APP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LISTP-APP-LISTN
(PROVE-LEMMA LISTP-CELLS
(REWRITE)
(EQUAL (LISTP (CELLS FLG 5 13 MSG))
(LISTP MSG))
((ENABLE CELLS CELL)))
Name the conjecture *1.
Let us appeal to the induction principle. There is only one suggested
induction. We will induct according to the following scheme:
(AND (IMPLIES (NLISTP MSG) (p FLG MSG))
(IMPLIES (AND (NOT (NLISTP MSG))
(p (CSIG FLG (CAR MSG)) (CDR MSG)))
(p FLG MSG))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to show that the measure (COUNT MSG) decreases according to
the well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for FLG. The above induction scheme
leads to the following two new goals:
Case 2. (IMPLIES (NLISTP MSG)
(EQUAL (LISTP (CELLS FLG 5 13 MSG))
(LISTP MSG))).
This simplifies, expanding the definitions of NLISTP, CELLS, LISTP, and
EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP MSG))
(EQUAL (LISTP (CELLS (CSIG FLG (CAR MSG))
5 13
(CDR MSG)))
(LISTP (CDR MSG))))
(EQUAL (LISTP (CELLS FLG 5 13 MSG))
(LISTP MSG))).
This simplifies, rewriting with APP-ASSOC and LISTP-APP-LISTN, and unfolding
the functions NLISTP, CELLS, CELL, EQUAL, and NUMBERP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LISTP-CELLS
(DISABLE LISTP-APP-LISTN)
[ 0.0 0.0 0.0 ]
LISTP-APP-LISTN-OFF
(PROVE-LEMMA CAR-APP
(REWRITE)
(EQUAL (CAR (APP A B))
(IF (LISTP A) (CAR A) (CAR B))))
This simplifies, trivially, to the following two new goals:
Case 2. (IMPLIES (NOT (LISTP A))
(EQUAL (CAR (APP A B)) (CAR B))).
This again simplifies, expanding APP, to:
T.
Case 1. (IMPLIES (LISTP A)
(EQUAL (CAR (APP A B)) (CAR A))).
Applying the lemma CAR-CDR-ELIM, replace A by (CONS X Z) to eliminate
(CAR A) and (CDR A). This produces:
(EQUAL (CAR (APP (CONS X Z) B)) X),
which further simplifies, rewriting with the lemmas CDR-CONS and CAR-CONS,
and expanding the function APP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CAR-APP
(PROVE-LEMMA LISTP-LISTN
(REWRITE)
(EQUAL (LISTP (LISTN N FLG))
(NOT (ZEROP N)))
((ENABLE LISTN)))
This formula simplifies, opening up the definitions of ZEROP and NOT, to three
new conjectures:
Case 3. (IMPLIES (NOT (NUMBERP N))
(EQUAL (LISTP (LISTN N FLG)) F)),
which again simplifies, unfolding the definitions of LISTN, LISTP, and EQUAL,
to:
T.
Case 2. (IMPLIES (EQUAL N 0)
(EQUAL (LISTP (LISTN N FLG)) F)),
which again simplifies, unfolding EQUAL, LISTN, and LISTP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL N 0)) (NUMBERP N))
(EQUAL (LISTP (LISTN N FLG)) T)),
which again simplifies, clearly, to:
(IMPLIES (AND (NOT (EQUAL N 0)) (NUMBERP N))
(LISTP (LISTN N FLG))),
which we will name *1.
Perhaps we can prove it by induction. There is only one plausible
induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP N) (p N FLG))
(IMPLIES (AND (NOT (ZEROP N)) (p (SUB1 N) FLG))
(p N FLG))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to prove that the measure (COUNT N) 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 N)
(NOT (EQUAL N 0))
(NUMBERP N))
(LISTP (LISTN N FLG))),
which simplifies, expanding the definition of ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (SUB1 N) 0)
(NOT (EQUAL N 0))
(NUMBERP N))
(LISTP (LISTN N FLG))),
which simplifies, unfolding ZEROP and LISTN, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(LISTP (LISTN (SUB1 N) FLG))
(NOT (EQUAL N 0))
(NUMBERP N))
(LISTP (LISTN N FLG))),
which simplifies, opening up the functions ZEROP and LISTN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LISTP-LISTN
(PROVE-LEMMA CAR-CELLS
(REWRITE)
(IMPLIES (LISTP MSG)
(EQUAL (CAR (CELLS FLG 5 13 MSG))
(B-NOT FLG)))
((EXPAND (CELLS FLG 5 13 MSG)
(LISTN 5 (B-NOT FLG)))
(ENABLE CELL LISTN)))
This simplifies, rewriting with CAR-CONS, CDR-CONS, and APP-ASSOC, and opening
up CELLS, APP, SUB1, NUMBERP, EQUAL, LISTN, and CELL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CAR-CELLS
(DISABLE CAR-APP)
[ 0.0 0.0 0.0 ]
CAR-APP-OFF
(PROVE-LEMMA TOP-SMOOTH-STEP
(REWRITE)
(IMPLIES (LISTP MSG)
(EQUAL (SMOOTH T
(APP (LISTN P1 T)
(APP (CELLS T 5 13 MSG)
(LISTN P2 T))))
(APP (LISTN P1 T)
(CONS 'Q
(SMOOTH F
(APP (CDR (CELLS T 5 13 MSG))
(LISTN P2 T)))))))
((ENABLE CELLS SMOOTH)))
This simplifies, rewriting with CAR-CELLS, LISTP-CELLS, CDR-CONS, CAR-CONS,
and SMOOTH-FLG-APP-LISTN-FLG, and expanding the definitions of B-NOT, APP,
B-XOR, and SMOOTH, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TOP-SMOOTH-STEP
(DISABLE SMOOTH-FLG-APP-LISTN-FLG)
[ 0.0 0.0 0.0 ]
SMOOTH-FLG-APP-LISTN-FLG-OFF
(DISABLE CAR-CELLS)
[ 0.0 0.0 0.0 ]
CAR-CELLS-OFF
(DISABLE LISTP-CELLS)
[ 0.0 0.0 0.0 ]
LISTP-CELLS-OFF
(DEFN ORACLE*
(LST ORACLE)
(IF (NLISTP LST)
ORACLE
(IF (EQUAL (CAR LST) 'Q)
(ORACLE* (CDR LST) (CDR ORACLE))
(ORACLE* (CDR LST) ORACLE))))
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP establish that the measure (COUNT LST) decreases
according to the well-founded relation LESSP in each recursive call. Hence,
ORACLE* is accepted under the principle of definition.
[ 0.0 0.0 0.0 ]
ORACLE*
(DISABLE ORACLE*)
[ 0.0 0.0 0.0 ]
ORACLE*-OFF
(PROVE-LEMMA DET-APP
(REWRITE)
(EQUAL (DET (APP LST1 LST2) ORACLE)
(APP (DET LST1 ORACLE)
(DET LST2 (ORACLE* LST1 ORACLE))))
((ENABLE DET ORACLE*)))
Call the conjecture *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 LST1)
(p LST1 LST2 ORACLE))
(IMPLIES (AND (NOT (NLISTP LST1))
(p (CDR LST1) LST2 (CDR ORACLE))
(p (CDR LST1) LST2 ORACLE))
(p LST1 LST2 ORACLE))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to establish that the measure (COUNT LST1) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. Note, however, the inductive instances chosen for ORACLE. The above
induction scheme generates two new formulas:
Case 2. (IMPLIES (NLISTP LST1)
(EQUAL (DET (APP LST1 LST2) ORACLE)
(APP (DET LST1 ORACLE)
(DET LST2 (ORACLE* LST1 ORACLE))))),
which simplifies, expanding the definitions of NLISTP, APP, DET, and ORACLE*,
to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST1))
(EQUAL (DET (APP (CDR LST1) LST2)
(CDR ORACLE))
(APP (DET (CDR LST1) (CDR ORACLE))
(DET LST2
(ORACLE* (CDR LST1) (CDR ORACLE)))))
(EQUAL (DET (APP (CDR LST1) LST2) ORACLE)
(APP (DET (CDR LST1) ORACLE)
(DET LST2
(ORACLE* (CDR LST1) ORACLE)))))
(EQUAL (DET (APP LST1 LST2) ORACLE)
(APP (DET LST1 ORACLE)
(DET LST2 (ORACLE* LST1 ORACLE))))),
which simplifies, applying the lemmas CDR-CONS and CAR-CONS, and unfolding
the definitions of NLISTP, APP, DET, and ORACLE*, to three new conjectures:
Case 1.3.
(IMPLIES (AND (LISTP LST1)
(EQUAL (DET (APP (CDR LST1) LST2)
(CDR ORACLE))
(APP (DET (CDR LST1) (CDR ORACLE))
(DET LST2
(ORACLE* (CDR LST1) (CDR ORACLE)))))
(EQUAL (DET (APP (CDR LST1) LST2) ORACLE)
(APP (DET (CDR LST1) ORACLE)
(DET LST2
(ORACLE* (CDR LST1) ORACLE))))
(NOT (EQUAL (CAR LST1) 'Q)))
(EQUAL (CONS (CAR LST1)
(DET (APP (CDR LST1) LST2) ORACLE))
(APP (CONS (CAR LST1)
(DET (CDR LST1) ORACLE))
(DET LST2
(ORACLE* (CDR LST1) ORACLE))))),
which again simplifies, rewriting with CDR-CONS and CAR-CONS, and
expanding the definition of APP, to:
T.
Case 1.2.
(IMPLIES (AND (LISTP LST1)
(EQUAL (DET (APP (CDR LST1) LST2)
(CDR ORACLE))
(APP (DET (CDR LST1) (CDR ORACLE))
(DET LST2
(ORACLE* (CDR LST1) (CDR ORACLE)))))
(EQUAL (DET (APP (CDR LST1) LST2) ORACLE)
(APP (DET (CDR LST1) ORACLE)
(DET LST2
(ORACLE* (CDR LST1) ORACLE))))
(EQUAL (CAR LST1) 'Q)
(CAR ORACLE))
(EQUAL (CONS T
(DET (APP (CDR LST1) LST2)
(CDR ORACLE)))
(APP (CONS T (DET (CDR LST1) (CDR ORACLE)))
(DET LST2
(ORACLE* (CDR LST1) (CDR ORACLE)))))).
But this again simplifies, appealing to the lemmas CDR-CONS and CAR-CONS,
and opening up the definition of APP, to:
T.
Case 1.1.
(IMPLIES (AND (LISTP LST1)
(EQUAL (DET (APP (CDR LST1) LST2)
(CDR ORACLE))
(APP (DET (CDR LST1) (CDR ORACLE))
(DET LST2
(ORACLE* (CDR LST1) (CDR ORACLE)))))
(EQUAL (DET (APP (CDR LST1) LST2) ORACLE)
(APP (DET (CDR LST1) ORACLE)
(DET LST2
(ORACLE* (CDR LST1) ORACLE))))
(EQUAL (CAR LST1) 'Q)
(NOT (CAR ORACLE)))
(EQUAL (CONS F
(DET (APP (CDR LST1) LST2)
(CDR ORACLE)))
(APP (CONS F (DET (CDR LST1) (CDR ORACLE)))
(DET LST2
(ORACLE* (CDR LST1) (CDR ORACLE)))))),
which again simplifies, rewriting with the lemmas CDR-CONS and CAR-CONS,
and expanding APP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
DET-APP
(PROVE-LEMMA DET-LISTN
(REWRITE)
(IMPLIES (NOT (EQUAL FLG 'Q))
(EQUAL (DET (LISTN N FLG) ORACLE)
(LISTN N FLG)))
((ENABLE DET LISTN)))
Name the conjecture *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 (ZEROP N) (p N FLG ORACLE))
(IMPLIES (AND (NOT (ZEROP N))
(p (SUB1 N) FLG ORACLE))
(p N FLG ORACLE))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT N) decreases according to the well-founded
relation LESSP in each induction step of the scheme. The above induction
scheme generates two new conjectures:
Case 2. (IMPLIES (AND (ZEROP N) (NOT (EQUAL FLG 'Q)))
(EQUAL (DET (LISTN N FLG) ORACLE)
(LISTN N FLG))),
which simplifies, opening up ZEROP, EQUAL, LISTN, LISTP, and DET, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (DET (LISTN (SUB1 N) FLG) ORACLE)
(LISTN (SUB1 N) FLG))
(NOT (EQUAL FLG 'Q)))
(EQUAL (DET (LISTN N FLG) ORACLE)
(LISTN N FLG))),
which simplifies, rewriting with CDR-CONS and CAR-CONS, and unfolding the
definitions of ZEROP, LISTN, and DET, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
DET-LISTN
(PROVE-LEMMA ORACLE*-LISTN
(REWRITE)
(IMPLIES (NOT (EQUAL FLG 'Q))
(EQUAL (ORACLE* (LISTN N FLG) ORACLE)
ORACLE))
((ENABLE ORACLE* LISTN)))
Name the conjecture *1.
Perhaps we can prove it by induction. There is only one plausible
induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP N) (p N FLG ORACLE))
(IMPLIES (AND (NOT (ZEROP N))
(p (SUB1 N) FLG ORACLE))
(p N FLG ORACLE))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT N) 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 conjectures:
Case 2. (IMPLIES (AND (ZEROP N) (NOT (EQUAL FLG 'Q)))
(EQUAL (ORACLE* (LISTN N FLG) ORACLE)
ORACLE)).
This simplifies, opening up ZEROP, EQUAL, LISTN, LISTP, and ORACLE*, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (ORACLE* (LISTN (SUB1 N) FLG) ORACLE)
ORACLE)
(NOT (EQUAL FLG 'Q)))
(EQUAL (ORACLE* (LISTN N FLG) ORACLE)
ORACLE)).
This simplifies, rewriting with CDR-CONS and CAR-CONS, and expanding the
functions ZEROP, LISTN, and ORACLE*, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
ORACLE*-LISTN
(PROVE-LEMMA LEN-SMOOTH
(REWRITE)
(EQUAL (LEN (SMOOTH FLG LST))
(LEN LST))
((ENABLE SMOOTH)))
Call the conjecture *1.
We will try to 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 (NLISTP LST) (p FLG LST))
(IMPLIES (AND (NOT (NLISTP LST))
(B-XOR FLG (CAR LST))
(p (CAR LST) (CDR LST)))
(p FLG LST))
(IMPLIES (AND (NOT (NLISTP LST))
(NOT (B-XOR FLG (CAR LST)))
(p (CAR LST) (CDR LST)))
(p FLG LST))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to establish that the measure (COUNT LST) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. Note, however, the inductive instances chosen for FLG. The above
induction scheme generates the following three new formulas:
Case 3. (IMPLIES (NLISTP LST)
(EQUAL (LEN (SMOOTH FLG LST))
(LEN LST))).
This simplifies, expanding the definitions of NLISTP, SMOOTH, LEN, and EQUAL,
to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST))
(B-XOR FLG (CAR LST))
(EQUAL (LEN (SMOOTH (CAR LST) (CDR LST)))
(LEN (CDR LST))))
(EQUAL (LEN (SMOOTH FLG LST))
(LEN LST))).
This simplifies, appealing to the lemma CDR-CONS, and opening up NLISTP,
SMOOTH, and LEN, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST))
(NOT (B-XOR FLG (CAR LST)))
(EQUAL (LEN (SMOOTH (CAR LST) (CDR LST)))
(LEN (CDR LST))))
(EQUAL (LEN (SMOOTH FLG LST))
(LEN LST))).
This simplifies, rewriting with CDR-CONS, and unfolding the definitions of
NLISTP, SMOOTH, and LEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LEN-SMOOTH
(PROVE-LEMMA CDR-APP
(REWRITE)
(EQUAL (CDR (APP A B))
(IF (LISTP A)
(APP (CDR A) B)
(CDR B))))
This simplifies, unfolding the function APP, to:
(IMPLIES (LISTP A)
(EQUAL (CDR (CONS (CAR A) (APP (CDR A) B)))
(APP (CDR A) B))),
which again simplifies, rewriting with the lemma CDR-CONS, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CDR-APP
(PROVE-LEMMA TOP-ASYNC-SEND-LEMMA1
(REWRITE)
(IMPLIES (LISTP MSG)
(LESSP 2
(LEN (CDR (CELLS T 5 13 MSG)))))
((EXPAND (CELLS T 5 13 MSG))
(ENABLE CELL)))
WARNING: Note that the proposed lemma TOP-ASYNC-SEND-LEMMA1 is to be stored
as zero type prescription rules, zero compound recognizer rules, one linear
rule, and zero replacement rules.
This formula simplifies, applying the lemmas APP-ASSOC, LISTP-LISTN, CDR-APP,
LEN-LISTN, LEN-APP, and PLUS-COMMUTES2, and unfolding CELLS, B-NOT, CELL,
EQUAL, and NUMBERP, to:
(IMPLIES (LISTP MSG)
(LESSP 2
(PLUS 13
(LEN (CDR (LISTN 5 F)))
(LEN (CELLS (CSIG T (CAR MSG))
5 13
(CDR MSG)))))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
TOP-ASYNC-SEND-LEMMA1
(DISABLE CDR-APP)
[ 0.0 0.0 0.0 ]
CDR-APP-OFF
(PROVE-LEMMA TOP-ASYNC-SEND
(REWRITE)
(IMPLIES
(AND (BVP MSG)
(LISTP MSG)
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(NUMBERP P1))
(EQUAL (ASYNC (SEND MSG P1 5 13 P2)
TS TR W R ORACLE)
(APP (LISTN (N* P1 TS TR W R) T)
(APP (DET (LISTN (NQG (NLST* P1 TS TR W R)
(NTS* P1 TS TR W R)
(NTR* P1 TS TR W R)
W R)
'Q)
ORACLE)
(DET (WARP (CDRN (DWG (NLST* P1 TS TR W R)
(NTS* P1 TS TR W R)
(NTR* P1 TS TR W R)
W R)
(SMOOTH F
(APP (CDR (CELLS T 5 13 MSG))
(LISTN P2 T))))
(TSG (NLST* P1 TS TR W R)
(NTS* P1 TS TR W R)
(NTR* P1 TS TR W R)
W R)
(TRG (NLST* P1 TS TR W R)
(NTS* P1 TS TR W R)
(NTR* P1 TS TR W R)
W R)
W R)
(ORACLE* (LISTN (NQG (NLST* P1 TS TR W R)
(NTS* P1 TS TR W R)
(NTR* P1 TS TR W R)
W R)
'Q)
ORACLE))))))
((DISABLE APP) (ENABLE ASYNC SEND)))
WARNING: Note that the rewrite rule TOP-ASYNC-SEND will be stored so as to
apply only to terms with the nonrecursive function symbol ASYNC.
This formula can be simplified, using the abbreviations RATE-PROXIMITY, ZEROP,
NOT, AND, IMPLIES, SEND, and ASYNC, to:
(IMPLIES
(AND (BVP MSG)
(LISTP MSG)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(NUMBERP P1))
(EQUAL (DET (WARP (SMOOTH T
(APP (LISTN P1 T)
(APP (CELLS T 5 13 MSG)
(LISTN P2 T))))
TS TR W R)
ORACLE)
(APP (LISTN (N* P1 TS TR W R) T)
(APP (DET (LISTN (NQG (NLST* P1 TS TR W R)
(NTS* P1 TS TR W R)
(NTR* P1 TS TR W R)
W R)
'Q)
ORACLE)
(DET (WARP (CDRN (DWG (NLST* P1 TS TR W R)
(NTS* P1 TS TR W R)
(NTR* P1 TS TR W R)
W R)
(SMOOTH F
(APP (CDR (CELLS T 5 13 MSG))
(LISTN P2 T))))
(TSG (NLST* P1 TS TR W R)
(NTS* P1 TS TR W R)
(NTR* P1 TS TR W R)
W R)
(TRG (NLST* P1 TS TR W R)
(NTS* P1 TS TR W R)
(NTR* P1 TS TR W R)
W R)
W R)
(ORACLE* (LISTN (NQG (NLST* P1 TS TR W R)
(NTS* P1 TS TR W R)
(NTR* P1 TS TR W R)
W R)
'Q)
ORACLE)))))),
which simplifies, using linear arithmetic, applying the lemmas TOP-SMOOTH-STEP,
TOP-ASYNC-SEND-LEMMA1, LEN-SMOOTH, LEN-APP, LEN-LISTN, WARP-APP-LISTN-Q,
DET-LISTN, ORACLE*-LISTN, and DET-APP, and expanding the definitions of SUB1,
NUMBERP, EQUAL, TIMES, NQ, DW, TS, and TR, to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
TOP-ASYNC-SEND
(DISABLE TOP-ASYNC-SEND-LEMMA1)
[ 0.0 0.0 0.0 ]
TOP-ASYNC-SEND-LEMMA1-OFF
(DISABLE TOP-SMOOTH-STEP)
[ 0.0 0.0 0.0 ]
TOP-SMOOTH-STEP-OFF
(PROVE-LEMMA SCAN-APP-LISTN
(REWRITE)
(EQUAL (SCAN FLG (APP (LISTN N FLG) REST))
(SCAN FLG REST))
((ENABLE SCAN LISTN)))
Call the conjecture *1.
Perhaps we can prove it by induction. Two inductions are suggested by
terms in the conjecture, 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 N) (p FLG N REST))
(IMPLIES (AND (NOT (ZEROP N))
(p FLG (SUB1 N) REST))
(p FLG N REST))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to prove that the measure (COUNT N) 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 N)
(EQUAL (SCAN FLG (APP (LISTN N FLG) REST))
(SCAN FLG REST))),
which simplifies, opening up the definitions of ZEROP, EQUAL, LISTN, LISTP,
and APP, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (SCAN FLG
(APP (LISTN (SUB1 N) FLG) REST))
(SCAN FLG REST)))
(EQUAL (SCAN FLG (APP (LISTN N FLG) REST))
(SCAN FLG REST))),
which simplifies, applying CDR-CONS, CAR-CONS, and B-XOR-X-X, and unfolding
ZEROP, LISTN, APP, and SCAN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
SCAN-APP-LISTN
(PROVE-LEMMA TOP-RECV-STEP
(REWRITE)
(EQUAL (RECV N T K (APP (LISTN P1 T) REST))
(RECV N T K REST))
((ENABLE RECV)))
Give the conjecture the name *1.
We will appeal to induction. Two inductions are suggested by terms in
the conjecture. However, they merge into one likely candidate induction. We
will induct according to the following scheme:
(AND (IMPLIES (ZEROP N) (p N K P1 REST))
(IMPLIES (AND (NOT (ZEROP N))
(p (SUB1 N)
K P1
(CDRN K (SCAN T REST))))
(p N K P1 REST))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to establish that the measure (COUNT N) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for REST. The above induction scheme
leads to two new goals:
Case 2. (IMPLIES (ZEROP N)
(EQUAL (RECV N T K (APP (LISTN P1 T) REST))
(RECV N T K REST))),
which simplifies, unfolding the functions ZEROP, EQUAL, and RECV, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (RECV (SUB1 N)
T K
(APP (LISTN P1 T)
(CDRN K (SCAN T REST))))
(RECV (SUB1 N)
T K
(CDRN K (SCAN T REST)))))
(EQUAL (RECV N T K (APP (LISTN P1 T) REST))
(RECV N T K REST))),
which simplifies, rewriting with the lemma SCAN-APP-LISTN, and opening up
ZEROP, RECV, and NTH, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
TOP-RECV-STEP
(PROVE-LEMMA NQG-BOUNDS
(REWRITE)
(AND (LESSP 0 (NQG N TS TR W R))
(NOT (LESSP 3 (NQG N TS TR W R))))
((ENABLE NQG)))
WARNING: Note that the proposed lemma NQG-BOUNDS is to be stored as zero type
prescription rules, zero compound recognizer rules, two linear rules, and zero
replacement rules.
This formula can be simplified, using the abbreviations NOT and AND, to the
following two new goals:
Case 2. (LESSP 0 (NQG N TS TR W R)).
This simplifies, rewriting with PLUS-COMMUTES2 and TIMES-COMMUTES1, and
unfolding the function NQG, to three new goals:
Case 2.3.
(IMPLIES (NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES N W))))
(LESSP 0 1)),
which again simplifies, using linear arithmetic, to:
T.
Case 2.2.
(IMPLIES (AND (LESSP (PLUS R TR)
(PLUS TS W (TIMES N W)))
(LESSP (PLUS R R TR)
(PLUS TS W (TIMES N W))))
(LESSP 0 3)),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (LESSP (PLUS R TR)
(PLUS TS W (TIMES N W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W (TIMES N W)))))
(LESSP 0 2)),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (NOT (LESSP 3 (NQG N TS TR W R))),
which simplifies, rewriting with PLUS-COMMUTES2 and TIMES-COMMUTES1, and
expanding the function NQG, to the following three new goals:
Case 1.3.
(IMPLIES (NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES N W))))
(NOT (LESSP 3 1))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (LESSP (PLUS R TR)
(PLUS TS W (TIMES N W)))
(LESSP (PLUS R R TR)
(PLUS TS W (TIMES N W))))
(NOT (LESSP 3 3))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (LESSP (PLUS R TR)
(PLUS TS W (TIMES N W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W (TIMES N W)))))
(NOT (LESSP 3 2))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NQG-BOUNDS
(PROVE-LEMMA DWG-BOUNDS
(REWRITE)
(NOT (LESSP 1 (DWG N TS TR W R)))
((ENABLE DWG)))
WARNING: Note that the proposed lemma DWG-BOUNDS is to be stored as zero type
prescription rules, zero compound recognizer rules, one linear rule, and zero
replacement rules.
This conjecture simplifies, expanding DWG, to the following five new goals:
Case 5. (IMPLIES (AND (LESSP (PLUS R TR)
(PLUS TS W (TIMES N W)))
(LESSP (PLUS R R TR)
(PLUS TS W W (TIMES N W))))
(NOT (LESSP 1 0))).
However this again simplifies, using linear arithmetic, to:
T.
Case 4. (IMPLIES (AND (NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES N W))))
(LESSP (PLUS R TR)
(PLUS TS W W (TIMES N W))))
(NOT (LESSP 1 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES N W))))
(EQUAL (PLUS R TR)
(PLUS TS W (TIMES N W))))
(NOT (LESSP 1 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (LESSP (PLUS R TR)
(PLUS TS W (TIMES N W))))
(NOT (EQUAL (PLUS R TR)
(PLUS TS W (TIMES N W))))
(NOT (LESSP (PLUS R TR)
(PLUS TS W W (TIMES N W)))))
(NOT (LESSP 1 1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (LESSP (PLUS R TR)
(PLUS TS W (TIMES N W)))
(NOT (LESSP (PLUS R R TR)
(PLUS TS W W (TIMES N W)))))
(NOT (LESSP 1 1))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
DWG-BOUNDS
(PROVE-LEMMA NOT-LESSP-TRG*-TSG*
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W)))
(NOT (LESSP (TRG (NLST* N TS TR W R)
(NTS* N TS TR W R)
(NTR* N TS TR W R)
W R)
(TSG (NLST* N TS TR W R)
(NTS* N TS TR W R)
(NTR* N TS TR W R)
W R))))
((ENABLE TRG TSG NQG DWG)))
WARNING: Note that the proposed lemma NOT-LESSP-TRG*-TSG* is to be stored as
zero type prescription rules, zero compound recognizer rules, two linear rules,
and zero replacement rules.
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to the new goal:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W)))
(NOT (LESSP (TRG (NLST* N TS TR W R)
(NTS* N TS TR W R)
(NTR* N TS TR W R)
W R)
(TSG (NLST* N TS TR W R)
(NTS* N TS TR W R)
(NTR* N TS TR W R)
W R)))),
which simplifies, rewriting with TIMES-COMMUTES1 and PLUS-COMMUTES2, and
unfolding the functions NQG, TRG, DWG, and TSG, to the following seven new
goals:
Case 7. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NOT (LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(NOT (LESSP (PLUS (NTR* N TS TR W R) (TIMES R 1))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))
(TIMES W 0))))).
However this again simplifies, applying PLUS-COMMUTES1 and TIMES-COMMUTES1,
and opening up the functions SUB1, NUMBERP, EQUAL, TIMES, and PLUS, to:
T.
Case 6. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NOT (LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(EQUAL (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(NOT (LESSP (PLUS (NTR* N TS TR W R) (TIMES R 1))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))
(TIMES W 0))))).
However this again simplifies, applying the lemmas PLUS-COMMUTES1 and
TIMES-COMMUTES1, and expanding the functions SUB1, NUMBERP, EQUAL, TIMES,
and PLUS, to:
T.
Case 5. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NOT (LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(NOT (EQUAL (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(NOT (LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))))
(NOT (LESSP (PLUS (NTR* N TS TR W R) (TIMES R 1))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))
(TIMES W 1))))),
which again simplifies, rewriting with PLUS-COMMUTES1, TIMES-COMMUTES1, and
PLUS-COMMUTES2, and expanding SUB1, NUMBERP, EQUAL, TIMES, and PLUS, to:
T.
Case 4. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(NOT (LESSP (PLUS (NTR* N TS TR W R) (TIMES R 3))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))
(TIMES W 0))))).
But this again simplifies, appealing to the lemmas TIMES-COMMUTES1,
PLUS-COMMUTES1, and PLUS-COMMUTES2, and expanding the definitions of SUB1,
NUMBERP, EQUAL, TIMES, and PLUS, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(NOT (LESSP (PLUS R
(TIMES 2 R)
(NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))).
This again simplifies, using linear arithmetic and applying
NOT-LESSP-PLUS-R-NTR*-PLUS-NTS*-TIMES-W-NLST*, to:
T.
Case 3. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(NOT (LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))))
(NOT (LESSP (PLUS (NTR* N TS TR W R) (TIMES R 2))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))
(TIMES W 0))))).
However this again simplifies, rewriting with the lemmas TIMES-COMMUTES1 and
PLUS-COMMUTES1, and opening up the functions EQUAL, TIMES, and PLUS, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(NOT (LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))))
(NOT (LESSP (PLUS (TIMES 2 R) (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(NOT (LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(NOT (LESSP (PLUS (NTR* N TS TR W R) (TIMES R 3))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))
(TIMES W 1))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(NOT (LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(NOT (LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))))
(NOT (LESSP (PLUS (NTR* N TS TR W R) (TIMES R 2))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))
(TIMES W 1))))),
which again simplifies, applying TIMES-COMMUTES1, PLUS-COMMUTES1, and
PLUS-COMMUTES2, and opening up the functions SUB1, NUMBERP, EQUAL, TIMES,
and PLUS, to the new goal:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(NOT (LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(NOT (LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))))
(NOT (LESSP (PLUS (TIMES 2 R) (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 1.7 0.1 ]
NOT-LESSP-TRG*-TSG*
(PROVE-LEMMA LESSP-TRG*-PLUS-W-TSG*
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W)))
(LESSP (TRG (NLST* N TS TR W R)
(NTS* N TS TR W R)
(NTR* N TS TR W R)
W R)
(PLUS W
(TSG (NLST* N TS TR W R)
(NTS* N TS TR W R)
(NTR* N TS TR W R)
W R))))
((ENABLE TRG TSG NQG DWG)))
WARNING: Note that the proposed lemma LESSP-TRG*-PLUS-W-TSG* is to be stored
as zero type prescription rules, zero compound recognizer rules, two linear
rules, and zero replacement rules.
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W)))
(LESSP (TRG (NLST* N TS TR W R)
(NTS* N TS TR W R)
(NTR* N TS TR W R)
W R)
(PLUS W
(TSG (NLST* N TS TR W R)
(NTS* N TS TR W R)
(NTR* N TS TR W R)
W R)))).
This simplifies, rewriting with TIMES-COMMUTES1 and PLUS-COMMUTES2, and
opening up the functions NQG, TRG, DWG, and TSG, to seven new formulas:
Case 7. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NOT (LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(LESSP (PLUS (NTR* N TS TR W R) (TIMES R 1))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))
(TIMES W 0)))),
which again simplifies, applying PLUS-COMMUTES1 and TIMES-COMMUTES1, and
expanding the functions SUB1, NUMBERP, EQUAL, TIMES, and PLUS, to:
T.
Case 6. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NOT (LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(EQUAL (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(LESSP (PLUS (NTR* N TS TR W R) (TIMES R 1))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))
(TIMES W 0)))).
This again simplifies, applying the lemmas PLUS-COMMUTES1, TIMES-COMMUTES1,
and PLUS-COMMUTES2, and expanding the definitions of SUB1, NUMBERP, EQUAL,
TIMES, and PLUS, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NOT (LESSP (PLUS R (NTR* N TS TR W R))
(PLUS R (NTR* N TS TR W R))))
(EQUAL (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS R W (NTR* N TS TR W R)))).
This again simplifies, using linear arithmetic, to:
T.
Case 5. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NOT (LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(NOT (EQUAL (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(NOT (LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))))
(LESSP (PLUS (NTR* N TS TR W R) (TIMES R 1))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))
(TIMES W 1)))),
which again simplifies, appealing to the lemmas PLUS-COMMUTES1,
TIMES-COMMUTES1, and PLUS-COMMUTES2, and unfolding SUB1, NUMBERP, EQUAL,
TIMES, and PLUS, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NOT (LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(NOT (EQUAL (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(NOT (LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))).
But this again simplifies, using linear arithmetic and rewriting with the
lemma LESSP-NTR*-NTS*, to:
T.
Case 4. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(LESSP (PLUS (NTR* N TS TR W R) (TIMES R 3))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))
(TIMES W 0)))),
which again simplifies, rewriting with the lemmas TIMES-COMMUTES1,
PLUS-COMMUTES1, and PLUS-COMMUTES2, and unfolding SUB1, NUMBERP, EQUAL,
TIMES, and PLUS, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(LESSP (PLUS R
(TIMES 2 R)
(NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))).
This again simplifies, using linear arithmetic and rewriting with
NOT-LESSP-PLUS-R-NTR*-PLUS-NTS*-TIMES-W-NLST*, to:
T.
Case 3. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(NOT (LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))))
(LESSP (PLUS (NTR* N TS TR W R) (TIMES R 2))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))
(TIMES W 0)))).
This again simplifies, applying the lemmas TIMES-COMMUTES1 and
PLUS-COMMUTES1, and unfolding the definitions of EQUAL, TIMES, and PLUS, to
the goal:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(NOT (LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))))
(LESSP (PLUS (TIMES 2 R) (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(NOT (LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(LESSP (PLUS (NTR* N TS TR W R) (TIMES R 3))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))
(TIMES W 1)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(NOT (LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(NOT (LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))))
(LESSP (PLUS (NTR* N TS TR W R) (TIMES R 2))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))
(TIMES W 1)))),
which again simplifies, rewriting with TIMES-COMMUTES1, PLUS-COMMUTES1, and
PLUS-COMMUTES2, and unfolding the functions SUB1, NUMBERP, EQUAL, TIMES, and
PLUS, to the new conjecture:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP (PLUS R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))
(NOT (LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R)))))
(NOT (LESSP (PLUS R R (NTR* N TS TR W R))
(PLUS W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))))
(LESSP (PLUS (TIMES 2 R) (NTR* N TS TR W R))
(PLUS W W W
(NTS* N TS TR W R)
(TIMES W (NLST* N TS TR W R))))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 2.0 0.0 ]
LESSP-TRG*-PLUS-W-TSG*
(PROVE-LEMMA CDR-APP-CELL-CELLS
(REWRITE)
(IMPLIES (NOT (ZEROP N1))
(EQUAL (CDR (APP (CELL FLG1 N1 N2 BIT)
(CELLS FLG2 N1 N2 MSG)))
(APP (CELL FLG1 (SUB1 N1) N2 BIT)
(CELLS FLG2 N1 N2 MSG))))
((ENABLE CDR-APP CELL LISTN)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, and
IMPLIES, to:
(IMPLIES (AND (NOT (EQUAL N1 0)) (NUMBERP N1))
(EQUAL (CDR (APP (CELL FLG1 N1 N2 BIT)
(CELLS FLG2 N1 N2 MSG)))
(APP (CELL FLG1 (SUB1 N1) N2 BIT)
(CELLS FLG2 N1 N2 MSG)))).
This simplifies, rewriting with APP-ASSOC, LISTP-LISTN, and CDR-APP, and
expanding the definition of CELL, to:
(IMPLIES (AND (NOT (EQUAL N1 0)) (NUMBERP N1))
(EQUAL (APP (CDR (LISTN N1 (B-NOT FLG1)))
(APP (LISTN N2 (CSIG FLG1 BIT))
(CELLS FLG2 N1 N2 MSG)))
(APP (LISTN (SUB1 N1) (B-NOT FLG1))
(APP (LISTN N2 (CSIG FLG1 BIT))
(CELLS FLG2 N1 N2 MSG))))).
However this again simplifies, rewriting with the lemma CDR-CONS, and opening
up LISTN, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CDR-APP-CELL-CELLS
(PROVE-LEMMA SMOOTH-FLG-LISTN-FLG
(REWRITE)
(IMPLIES (NOT (B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG1 (LISTN N FLG2))
(LISTN N FLG2)))
((ENABLE SMOOTH LISTN)))
Give the conjecture the name *1.
Let us appeal to the induction principle. 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 (ZEROP N) (p FLG1 N FLG2))
(IMPLIES (AND (NOT (ZEROP N))
(p FLG1 (SUB1 N) FLG2))
(p FLG1 N FLG2))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to show that the measure (COUNT N) 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 (ZEROP N)
(NOT (B-XOR FLG1 FLG2)))
(EQUAL (SMOOTH FLG1 (LISTN N FLG2))
(LISTN N FLG2))).
This simplifies, opening up the functions ZEROP, EQUAL, LISTN, LISTP, and
SMOOTH, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (SMOOTH FLG1 (LISTN (SUB1 N) FLG2))
(LISTN (SUB1 N) FLG2))
(NOT (B-XOR FLG1 FLG2)))
(EQUAL (SMOOTH FLG1 (LISTN N FLG2))
(LISTN N FLG2))).
This simplifies, rewriting with CDR-CONS, CAR-CONS, and CONS-EQUAL, and
opening up the definitions of ZEROP, LISTN, and SMOOTH, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (SMOOTH FLG1 (LISTN (SUB1 N) FLG2))
(LISTN (SUB1 N) FLG2))
(NOT (B-XOR FLG1 FLG2)))
(EQUAL (SMOOTH FLG2 (LISTN (SUB1 N) FLG2))
(LISTN (SUB1 N) FLG2))).
Appealing to the lemma SUB1-ELIM, we now replace N by (ADD1 X) to eliminate
(SUB1 N). We use the type restriction lemma noted when SUB1 was introduced
to constrain the new variable. This generates:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (ADD1 X) 0))
(EQUAL (SMOOTH FLG1 (LISTN X FLG2))
(LISTN X FLG2))
(NOT (B-XOR FLG1 FLG2)))
(EQUAL (SMOOTH FLG2 (LISTN X FLG2))
(LISTN X FLG2))).
This further simplifies, trivially, to:
(IMPLIES (AND (NUMBERP X)
(EQUAL (SMOOTH FLG1 (LISTN X FLG2))
(LISTN X FLG2))
(NOT (B-XOR FLG1 FLG2)))
(EQUAL (SMOOTH FLG2 (LISTN X FLG2))
(LISTN X FLG2))).
We use the above equality hypothesis by cross-fertilizing:
(SMOOTH FLG1 (LISTN X FLG2))
for (LISTN X FLG2) and throwing away the equality. We must thus prove:
(IMPLIES (AND (NUMBERP X)
(NOT (B-XOR FLG1 FLG2)))
(EQUAL (SMOOTH FLG2 (LISTN X FLG2))
(SMOOTH FLG1 (LISTN X FLG2)))).
This further simplifies, rewriting with SMOOTH-CONGRUENCE, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
SMOOTH-FLG-LISTN-FLG
(PROVE-LEMMA NOT-B-XOR-B-NOT
(REWRITE)
(IMPLIES (B-XOR FLG1 FLG2)
(AND (NOT (B-XOR FLG1 (B-NOT FLG2)))
(NOT (B-XOR (B-NOT FLG2) FLG1))))
((ENABLE B-XOR B-NOT)))
WARNING: Note that the proposed lemma NOT-B-XOR-B-NOT is to be stored as zero
type prescription rules, zero compound recognizer rules, zero linear rules,
and two replacement rules.
This formula simplifies, opening up B-XOR, B-NOT, NOT, and AND, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NOT-B-XOR-B-NOT
(PROVE-LEMMA SMOOTH-FLG-APP-LISTN-NOT-FLG
(REWRITE)
(IMPLIES (AND (NOT (ZEROP N))
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG1
(APP (LISTN N FLG2) REST))
(APP (SMOOTH FLG1 (LISTN N FLG2))
(SMOOTH FLG2 REST))))
((INDUCT (LISTN N FLG2))
(ENABLE SMOOTH LISTN)))
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 N)
(NOT (EQUAL N 0))
(NUMBERP N)
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG1
(APP (LISTN N FLG2) REST))
(APP (SMOOTH FLG1 (LISTN N FLG2))
(SMOOTH FLG2 REST)))).
This simplifies, unfolding the definition of ZEROP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(IMPLIES (AND (NOT (ZEROP (SUB1 N)))
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG1
(APP (LISTN (SUB1 N) FLG2) REST))
(APP (SMOOTH FLG1 (LISTN (SUB1 N) FLG2))
(SMOOTH FLG2 REST))))
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG1
(APP (LISTN N FLG2) REST))
(APP (SMOOTH FLG1 (LISTN N FLG2))
(SMOOTH FLG2 REST)))).
This simplifies, applying CDR-CONS, CAR-CONS, SMOOTH-FLG-LISTN-FLG,
B-XOR-X-X, and CONS-EQUAL, and expanding the definitions of ZEROP, NOT, AND,
IMPLIES, LISTN, EQUAL, APP, LISTP, SMOOTH, CONS, CDR, and CAR, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (SMOOTH FLG1
(APP (LISTN (SUB1 N) FLG2) REST))
(APP (SMOOTH FLG1 (LISTN (SUB1 N) FLG2))
(SMOOTH FLG2 REST)))
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG2
(APP (LISTN (SUB1 N) FLG2) REST))
(APP (LISTN (SUB1 N) FLG2)
(SMOOTH FLG2 REST)))).
Appealing to the lemma SUB1-ELIM, we now replace N by (ADD1 X) to eliminate
(SUB1 N). We employ the type restriction lemma noted when SUB1 was
introduced to constrain the new variable. We must thus prove:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (ADD1 X) 0))
(EQUAL (SMOOTH FLG1
(APP (LISTN X FLG2) REST))
(APP (SMOOTH FLG1 (LISTN X FLG2))
(SMOOTH FLG2 REST)))
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG2
(APP (LISTN X FLG2) REST))
(APP (LISTN X FLG2)
(SMOOTH FLG2 REST)))).
This further simplifies, clearly, to:
(IMPLIES (AND (NUMBERP X)
(EQUAL (SMOOTH FLG1
(APP (LISTN X FLG2) REST))
(APP (SMOOTH FLG1 (LISTN X FLG2))
(SMOOTH FLG2 REST)))
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG2
(APP (LISTN X FLG2) REST))
(APP (LISTN X FLG2)
(SMOOTH FLG2 REST)))),
which we will name *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 FLG2 X REST FLG1))
(IMPLIES (AND (NOT (ZEROP X))
(p FLG2 (SUB1 X) REST FLG1))
(p FLG2 X REST FLG1))).
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 three new formulas:
Case 3. (IMPLIES (AND (ZEROP X)
(NUMBERP X)
(EQUAL (SMOOTH FLG1
(APP (LISTN X FLG2) REST))
(APP (SMOOTH FLG1 (LISTN X FLG2))
(SMOOTH FLG2 REST)))
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG2
(APP (LISTN X FLG2) REST))
(APP (LISTN X FLG2)
(SMOOTH FLG2 REST)))),
which simplifies, unfolding ZEROP, NUMBERP, EQUAL, LISTN, LISTP, APP, and
SMOOTH, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP X))
(NOT (EQUAL (SMOOTH FLG1
(APP (LISTN (SUB1 X) FLG2) REST))
(APP (SMOOTH FLG1 (LISTN (SUB1 X) FLG2))
(SMOOTH FLG2 REST))))
(NUMBERP X)
(EQUAL (SMOOTH FLG1
(APP (LISTN X FLG2) REST))
(APP (SMOOTH FLG1 (LISTN X FLG2))
(SMOOTH FLG2 REST)))
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG2
(APP (LISTN X FLG2) REST))
(APP (LISTN X FLG2)
(SMOOTH FLG2 REST)))),
which simplifies, applying CDR-CONS, CAR-CONS, SMOOTH-FLG-LISTN-FLG,
B-XOR-X-X, and CONS-EQUAL, and expanding ZEROP, LISTN, APP, SMOOTH, and
EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP X))
(EQUAL (SMOOTH FLG2
(APP (LISTN (SUB1 X) FLG2) REST))
(APP (LISTN (SUB1 X) FLG2)
(SMOOTH FLG2 REST)))
(NUMBERP X)
(EQUAL (SMOOTH FLG1
(APP (LISTN X FLG2) REST))
(APP (SMOOTH FLG1 (LISTN X FLG2))
(SMOOTH FLG2 REST)))
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG2
(APP (LISTN X FLG2) REST))
(APP (LISTN X FLG2)
(SMOOTH FLG2 REST)))).
This simplifies, rewriting with the lemmas CDR-CONS, CAR-CONS,
SMOOTH-FLG-LISTN-FLG, and B-XOR-X-X, and opening up ZEROP, LISTN, APP, and
SMOOTH, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
SMOOTH-FLG-APP-LISTN-NOT-FLG
(PROVE-LEMMA SMOOTH-APP-CELL-APP-CELLS
(REWRITE)
(IMPLIES (AND (NOT (ZEROP N1))
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG1
(APP (CELL FLG2 M1 N1 BIT)
(APP (CELLS (CSIG FLG2 BIT) M N MSG)
(LISTN P2 T))))
(APP (SMOOTH FLG1 (CELL FLG2 M1 N1 BIT))
(SMOOTH (CSIG FLG2 BIT)
(APP (CELLS (CSIG FLG2 BIT) M N MSG)
(LISTN P2 T))))))
((ENABLE SMOOTH LISTN CELL CSIG SMOOTH-FLG-APP-LISTN-FLG)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to the goal:
(IMPLIES (AND (NOT (EQUAL N1 0))
(NUMBERP N1)
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG1
(APP (CELL FLG2 M1 N1 BIT)
(APP (CELLS (CSIG FLG2 BIT) M N MSG)
(LISTN P2 T))))
(APP (SMOOTH FLG1 (CELL FLG2 M1 N1 BIT))
(SMOOTH (CSIG FLG2 BIT)
(APP (CELLS (CSIG FLG2 BIT) M N MSG)
(LISTN P2 T)))))).
This simplifies, rewriting with APP-ASSOC, NOT-B-XOR-B-NOT,
SMOOTH-FLG-APP-LISTN-FLG, and APP-CANCELLATION, and unfolding the functions
CSIG and CELL, to two new formulas:
Case 2. (IMPLIES (AND (NOT (EQUAL N1 0))
(NUMBERP N1)
(B-XOR FLG1 FLG2)
(NOT BIT))
(EQUAL (SMOOTH FLG1
(APP (LISTN N1 (B-NOT FLG2))
(APP (CELLS (B-NOT FLG2) M N MSG)
(LISTN P2 T))))
(APP (SMOOTH FLG1 (LISTN N1 (B-NOT FLG2)))
(SMOOTH (B-NOT FLG2)
(APP (CELLS (B-NOT FLG2) M N MSG)
(LISTN P2 T)))))),
which again simplifies, appealing to the lemmas NOT-B-XOR-B-NOT,
SMOOTH-FLG-APP-LISTN-FLG, SMOOTH-FLG-LISTN-FLG, SMOOTH-CONGRUENCE, and
APP-CANCELLATION, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL N1 0))
(NUMBERP N1)
(B-XOR FLG1 FLG2)
BIT)
(EQUAL (SMOOTH FLG1
(APP (LISTN N1 FLG2)
(APP (CELLS FLG2 M N MSG)
(LISTN P2 T))))
(APP (SMOOTH FLG1 (LISTN N1 FLG2))
(SMOOTH FLG2
(APP (CELLS FLG2 M N MSG)
(LISTN P2 T)))))),
which again simplifies, applying the lemma SMOOTH-FLG-APP-LISTN-NOT-FLG, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
SMOOTH-APP-CELL-APP-CELLS
(DISABLE SMOOTH-FLG-LISTN-FLG)
[ 0.0 0.0 0.0 ]
SMOOTH-FLG-LISTN-FLG-OFF
(DISABLE SMOOTH-FLG-APP-LISTN-NOT-FLG)
[ 0.0 0.0 0.0 ]
SMOOTH-FLG-APP-LISTN-NOT-FLG-OFF
(PROVE-LEMMA B-XOR-COMMUTES
(REWRITE)
(IMPLIES (B-XOR X Y) (B-XOR Y X))
((ENABLE B-XOR)))
This formula simplifies, unfolding the definition of B-XOR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
B-XOR-COMMUTES
(PROVE-LEMMA LISTP-SMOOTH-CELL
(REWRITE)
(IMPLIES (NOT (ZEROP M))
(LISTP (SMOOTH FLG1 (CELL FLG2 M N BIT))))
((ENABLE CELL SMOOTH)
(EXPAND (LISTN M (B-NOT FLG2)))))
This formula can be simplified, using the abbreviations ZEROP, NOT, and
IMPLIES, to the new conjecture:
(IMPLIES (AND (NOT (EQUAL M 0)) (NUMBERP M))
(LISTP (SMOOTH FLG1 (CELL FLG2 M N BIT)))),
which simplifies, rewriting with CAR-CONS and CDR-CONS, and opening up APP,
LISTN, CELL, and SMOOTH, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LISTP-SMOOTH-CELL
(PROVE-LEMMA CDRN-DW-APP-SMOOTH-CELL
(REWRITE)
(IMPLIES (AND (NOT (ZEROP M))
(NUMBERP DW)
(NOT (LESSP 1 DW)))
(EQUAL (CDRN DW
(APP (SMOOTH FLG1 (CELL FLG2 M N BIT))
REST))
(APP (CDRN DW
(SMOOTH FLG1 (CELL FLG2 M N BIT)))
REST)))
((ENABLE CDR-APP)
(EXPAND (CDRN DW
(APP (SMOOTH FLG1 (CELL FLG2 M N BIT))
REST))
(CDRN 1
(SMOOTH FLG1 (CELL FLG2 M N BIT))))))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (NOT (EQUAL M 0))
(NUMBERP M)
(NUMBERP DW)
(NOT (LESSP 1 DW)))
(EQUAL (CDRN DW
(APP (SMOOTH FLG1 (CELL FLG2 M N BIT))
REST))
(APP (CDRN DW
(SMOOTH FLG1 (CELL FLG2 M N BIT)))
REST))),
which simplifies, applying the lemmas LISTP-SMOOTH-CELL and CDR-APP, and
opening up the definition of CDRN, to two new conjectures:
Case 2. (IMPLIES (AND (NOT (EQUAL M 0))
(NUMBERP M)
(NUMBERP DW)
(NOT (LESSP 1 DW))
(NOT (EQUAL DW 0)))
(EQUAL (CDRN (SUB1 DW)
(APP (CDR (SMOOTH FLG1 (CELL FLG2 M N BIT)))
REST))
(APP (CDRN DW
(SMOOTH FLG1 (CELL FLG2 M N BIT)))
REST))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (EQUAL M 0))
(NUMBERP M)
(NUMBERP 1)
(NOT (LESSP 1 1))
(NOT (EQUAL 1 0)))
(EQUAL (CDRN (SUB1 1)
(APP (CDR (SMOOTH FLG1 (CELL FLG2 M N BIT)))
REST))
(APP (CDRN 1
(SMOOTH FLG1 (CELL FLG2 M N BIT)))
REST))).
However this again simplifies, unfolding NUMBERP, LESSP, EQUAL, SUB1, and
CDRN, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL M 0))
(NUMBERP M)
(NUMBERP DW)
(NOT (LESSP 1 DW))
(EQUAL DW 0))
(EQUAL (APP (SMOOTH FLG1 (CELL FLG2 M N BIT))
REST)
(APP (CDRN DW
(SMOOTH FLG1 (CELL FLG2 M N BIT)))
REST))),
which again simplifies, opening up the functions NUMBERP, LESSP, EQUAL, and
CDRN, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CDRN-DW-APP-SMOOTH-CELL
(PROVE-LEMMA CAR-LISTN
(REWRITE)
(EQUAL (CAR (LISTN N FLG))
(IF (ZEROP N) 0 FLG))
((ENABLE LISTN)))
This conjecture simplifies, unfolding ZEROP, to three new conjectures:
Case 3. (IMPLIES (NOT (NUMBERP N))
(EQUAL (CAR (LISTN N FLG)) 0)),
which again simplifies, opening up LISTN, CAR, and EQUAL, to:
T.
Case 2. (IMPLIES (EQUAL N 0)
(EQUAL (CAR (LISTN N FLG)) 0)),
which again simplifies, expanding the functions EQUAL, LISTN, and CAR, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL N 0)) (NUMBERP N))
(EQUAL (CAR (LISTN N FLG)) FLG)),
which we will name *1.
Perhaps we can prove it by induction. There is only one plausible
induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP N) (p N FLG))
(IMPLIES (AND (NOT (ZEROP N)) (p (SUB1 N) FLG))
(p N FLG))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT N) decreases according to the well-founded relation
LESSP in each induction step of the scheme. The above induction scheme
produces the following three new conjectures:
Case 3. (IMPLIES (AND (ZEROP N)
(NOT (EQUAL N 0))
(NUMBERP N))
(EQUAL (CAR (LISTN N FLG)) FLG)).
This simplifies, expanding the definition of ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (SUB1 N) 0)
(NOT (EQUAL N 0))
(NUMBERP N))
(EQUAL (CAR (LISTN N FLG)) FLG)).
This simplifies, applying CAR-CONS, and expanding ZEROP and LISTN, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (CAR (LISTN (SUB1 N) FLG)) FLG)
(NOT (EQUAL N 0))
(NUMBERP N))
(EQUAL (CAR (LISTN N FLG)) FLG)),
which simplifies, appealing to the lemma CAR-CONS, and unfolding the
functions ZEROP and LISTN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
CAR-LISTN
(PROVE-LEMMA CDRN-DW-SMOOTH-CELL
(REWRITE)
(IMPLIES (AND (NOT (ZEROP M))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(B-XOR FLG1 FLG2))
(EQUAL (CDRN DW
(SMOOTH FLG2
(CELL FLG1 M N (CAR MSG))))
(SMOOTH FLG2
(CELL FLG1
(DIFFERENCE M DW)
N
(CAR MSG)))))
((ENABLE CDR-APP CELL LISTN-ADD1 SMOOTH)
(EXPAND (LISTN M (B-NOT FLG1))
(CDRN DW
(CONS (B-NOT FLG1)
(SMOOTH (B-NOT FLG1)
(APP (LISTN (SUB1 M) (B-NOT FLG1))
(LISTN N (CSIG FLG1 (CAR MSG)))))))
(PLUS 1 X))
(DO-NOT-INDUCT T)))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to the new formula:
(IMPLIES (AND (NOT (EQUAL M 0))
(NUMBERP M)
(NUMBERP DW)
(NOT (LESSP 1 DW))
(B-XOR FLG1 FLG2))
(EQUAL (CDRN DW
(SMOOTH FLG2
(CELL FLG1 M N (CAR MSG))))
(SMOOTH FLG2
(CELL FLG1
(DIFFERENCE M DW)
N
(CAR MSG))))),
which simplifies, applying CAR-CONS, CDR-CONS, NOT-B-XOR-B-NOT, and
B-XOR-COMMUTES, and unfolding the definitions of APP, LISTN, CELL, SMOOTH, and
CDRN, to the following two new conjectures:
Case 2. (IMPLIES (AND (NOT (EQUAL M 0))
(NUMBERP M)
(NUMBERP DW)
(NOT (LESSP 1 DW))
(B-XOR FLG1 FLG2)
(NOT (EQUAL DW 0)))
(EQUAL (CDRN (SUB1 DW)
(SMOOTH (B-NOT FLG1)
(APP (LISTN (SUB1 M) (B-NOT FLG1))
(LISTN N (CSIG FLG1 (CAR MSG))))))
(SMOOTH FLG2
(APP (LISTN (DIFFERENCE M DW) (B-NOT FLG1))
(LISTN N (CSIG FLG1 (CAR MSG))))))).
However this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (EQUAL M 0))
(NUMBERP M)
(NUMBERP 1)
(NOT (LESSP 1 1))
(B-XOR FLG1 FLG2)
(NOT (EQUAL 1 0)))
(EQUAL (CDRN (SUB1 1)
(SMOOTH (B-NOT FLG1)
(APP (LISTN (SUB1 M) (B-NOT FLG1))
(LISTN N (CSIG FLG1 (CAR MSG))))))
(SMOOTH FLG2
(APP (LISTN (DIFFERENCE M 1) (B-NOT FLG1))
(LISTN N (CSIG FLG1 (CAR MSG))))))).
But this again simplifies, expanding the functions NUMBERP, LESSP, EQUAL,
SUB1, and CDRN, to:
(IMPLIES (AND (NOT (EQUAL M 0))
(NUMBERP M)
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH (B-NOT FLG1)
(APP (LISTN (SUB1 M) (B-NOT FLG1))
(LISTN N (CSIG FLG1 (CAR MSG)))))
(SMOOTH FLG2
(APP (LISTN (DIFFERENCE M 1) (B-NOT FLG1))
(LISTN N (CSIG FLG1 (CAR MSG))))))).
Appealing to the lemma DIFFERENCE-ELIM, we now replace M by (PLUS 1 X) to
eliminate (DIFFERENCE M 1). We use the type restriction lemma noted when
DIFFERENCE was introduced to constrain the new variable. We must thus prove
two new goals:
Case 2.2.
(IMPLIES (AND (LESSP M 1)
(NOT (EQUAL M 0))
(NUMBERP M)
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH (B-NOT FLG1)
(APP (LISTN (SUB1 M) (B-NOT FLG1))
(LISTN N (CSIG FLG1 (CAR MSG)))))
(SMOOTH FLG2
(APP (LISTN (DIFFERENCE M 1) (B-NOT FLG1))
(LISTN N (CSIG FLG1 (CAR MSG))))))),
which further simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NUMBERP X)
(NOT (LESSP (PLUS 1 X) 1))
(NOT (EQUAL (PLUS 1 X) 0))
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH (B-NOT FLG1)
(APP (LISTN (SUB1 (PLUS 1 X)) (B-NOT FLG1))
(LISTN N (CSIG FLG1 (CAR MSG)))))
(SMOOTH FLG2
(APP (LISTN X (B-NOT FLG1))
(LISTN N (CSIG FLG1 (CAR MSG))))))),
which further simplifies, appealing to the lemmas SUB1-ADD1,
NOT-B-XOR-B-NOT, B-XOR-COMMUTES, and SMOOTH-CONGRUENCE, and expanding PLUS,
EQUAL, NUMBERP, SUB1, and LESSP, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL M 0))
(NUMBERP M)
(NUMBERP DW)
(NOT (LESSP 1 DW))
(B-XOR FLG1 FLG2)
(EQUAL DW 0))
(EQUAL (CONS (B-NOT FLG1)
(SMOOTH (B-NOT FLG1)
(APP (LISTN (SUB1 M) (B-NOT FLG1))
(LISTN N (CSIG FLG1 (CAR MSG))))))
(SMOOTH FLG2
(APP (LISTN (DIFFERENCE M DW) (B-NOT FLG1))
(LISTN N (CSIG FLG1 (CAR MSG))))))),
which again simplifies, applying the lemmas CDR-CONS, CAR-CONS,
NOT-B-XOR-B-NOT, and B-XOR-COMMUTES, and unfolding the definitions of
NUMBERP, LESSP, EQUAL, DIFFERENCE, LISTN, APP, and SMOOTH, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CDRN-DW-SMOOTH-CELL
(DISABLE CAR-LISTN)
[ 0.0 0.0 0.0 ]
CAR-LISTN-OFF
(PROVE-LEMMA LEN-CELL
(REWRITE)
(EQUAL (LEN (CELL FLG M N BIT))
(PLUS M N))
((ENABLE CELL)))
This conjecture simplifies, applying LEN-LISTN and LEN-APP, and unfolding the
function CELL, to three new goals:
Case 3. (IMPLIES (AND (NOT (NUMBERP N))
(NOT (NUMBERP M)))
(EQUAL (PLUS 0 0) (PLUS M N))),
which again simplifies, expanding the definitions of PLUS and EQUAL, to:
T.
Case 2. (IMPLIES (AND (NOT (NUMBERP N)) (NUMBERP M))
(EQUAL (PLUS M 0) (PLUS M N))),
which again simplifies, applying PLUS-COMMUTES1, and expanding the
definitions of EQUAL and PLUS, to:
(IMPLIES (AND (NOT (NUMBERP N)) (NUMBERP M))
(EQUAL M (PLUS M N))),
which we will name *1.
Case 1. (IMPLIES (AND (NUMBERP N) (NOT (NUMBERP M)))
(EQUAL (PLUS 0 N) (PLUS M N))).
But this again simplifies, opening up the functions EQUAL and PLUS, to:
T.
So next consider:
(IMPLIES (AND (NOT (NUMBERP N)) (NUMBERP M))
(EQUAL M (PLUS M N))),
which we named *1 above. 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 M) (p M N))
(IMPLIES (AND (NOT (ZEROP M)) (p (SUB1 M) N))
(p M N))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definition
of ZEROP can be used to prove that the measure (COUNT M) 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 (AND (ZEROP M)
(NOT (NUMBERP N))
(NUMBERP M))
(EQUAL M (PLUS M N))).
This simplifies, opening up the definitions of ZEROP, NUMBERP, EQUAL, and
PLUS, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP M))
(EQUAL (SUB1 M) (PLUS (SUB1 M) N))
(NOT (NUMBERP N))
(NUMBERP M))
(EQUAL M (PLUS M N))).
This simplifies, using linear arithmetic, to the new goal:
(IMPLIES (AND (EQUAL M 0)
(NOT (ZEROP M))
(EQUAL (SUB1 M) (PLUS (SUB1 M) N))
(NOT (NUMBERP N))
(NUMBERP M))
(EQUAL M (PLUS M N))),
which again simplifies, expanding ZEROP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LEN-CELL
(PROVE-LEMMA ADD1-PLUS-12-DIFFERENCE-4-DW
(REWRITE)
(IMPLIES (NOT (LESSP 1 DW))
(EQUAL (ADD1 (PLUS 12 (DIFFERENCE 4 DW)))
(DIFFERENCE 17 DW))))
This conjecture simplifies, using linear arithmetic, to two new formulas:
Case 2. (IMPLIES (AND (LESSP 4 DW) (NOT (LESSP 1 DW)))
(EQUAL (ADD1 (PLUS 12 (DIFFERENCE 4 DW)))
(DIFFERENCE 17 DW))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (LESSP 17 DW) (NOT (LESSP 1 DW)))
(EQUAL (ADD1 (PLUS 12 (DIFFERENCE 4 DW)))
(DIFFERENCE 17 DW))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
ADD1-PLUS-12-DIFFERENCE-4-DW
(PROVE-LEMMA LST*-IS-LASTN-NLST*
(REWRITE)
(EQUAL (LST* LST TS TR W R)
(LASTN (NLST* (LEN LST) TS TR W R)
LST))
((USE (LST*-IS-LASTN))))
WARNING: the newly proposed lemma, LST*-IS-LASTN-NLST*, could be applied
whenever the previously added lemma LST*-LISTN could.
This conjecture can be simplified, using the abbreviation LEN-LST*, to:
(IMPLIES (EQUAL (LASTN (NLST* (LEN LST) TS TR W R)
LST)
(LST* LST TS TR W R))
(EQUAL (LST* LST TS TR W R)
(LASTN (NLST* (LEN LST) TS TR W R)
LST))).
This simplifies, trivially, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LST*-IS-LASTN-NLST*
(PROVE-LEMMA LASTN-APP
(REWRITE)
(IMPLIES (NOT (LESSP (LEN B) N))
(EQUAL (LASTN N (APP A B))
(LASTN N B))))
Name the conjecture *1.
We will try to prove it by induction. Four inductions are suggested by
terms in the conjecture. They merge into three likely candidate inductions.
However, only one is unflawed. We will induct according to the following
scheme:
(AND (IMPLIES (NLISTP A) (p N A B))
(IMPLIES (AND (NOT (NLISTP A)) (p N (CDR A) B))
(p N A B))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP establish that the measure (COUNT A) decreases according to the
well-founded relation LESSP in each induction step of the scheme. The above
induction scheme generates two new conjectures:
Case 2. (IMPLIES (AND (NLISTP A)
(NOT (LESSP (LEN B) N)))
(EQUAL (LASTN N (APP A B))
(LASTN N B))),
which simplifies, opening up NLISTP and APP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP A))
(EQUAL (LASTN N (APP (CDR A) B))
(LASTN N B))
(NOT (LESSP (LEN B) N)))
(EQUAL (LASTN N (APP A B))
(LASTN N B))),
which simplifies, rewriting with LEN-APP, PLUS-COMMUTES1, and CDR-CONS, and
unfolding the definitions of NLISTP, APP, LEN, and LASTN, to the new
conjecture:
(IMPLIES (AND (LISTP A)
(EQUAL (LASTN N (APP (CDR A) B))
(LASTN N B))
(NOT (LESSP (LEN B) N))
(EQUAL N
(ADD1 (PLUS (LEN B) (LEN (CDR A))))))
(EQUAL (CONS (CAR A) (APP (CDR A) B))
(LASTN N B))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LASTN-APP
(PROVE-LEMMA NOT-LESSP-2-NLST*
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W)))
(NOT (LESSP 2 (NLST* N TS TR W R)))))
WARNING: Note that the proposed lemma NOT-LESSP-2-NLST* is to be stored as
zero type prescription rules, zero compound recognizer rules, one linear rule,
and zero replacement rules.
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to the goal:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W)))
(NOT (LESSP 2 (NLST* N TS TR W R)))).
Name the above subgoal *1.
Perhaps we can prove it by induction. The recursive terms in the
conjecture suggest seven inductions. They merge into four likely candidate
inductions, two 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 (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W))
(p N TS TR W R))
(IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W)))
(p (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R))
(p N TS TR W R))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, SUB1-ADD1, NLST+-EQUAL-N,
ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LESSP-NLST+, and the definitions
of LISTP, ORDINALP, NLST+, LESSP, ORD-LESSP, EQUAL, OR, ZEROP, NTS+, and NENDP
inform us that the measure:
(CONS (CONS (ADD1 N) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each induction
step of the scheme. The above induction scheme leads to the following five
new formulas:
Case 5. (IMPLIES (AND (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W)))
(NOT (LESSP 2 (NLST* N TS TR W R)))).
This simplifies, rewriting with the lemma PLUS-COMMUTES1, and unfolding the
functions ZEROP, OR, and NLST*, to:
(IMPLIES (AND (NENDP N TS (PLUS R TR) W)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W)))
(NOT (LESSP 2 N))),
which again simplifies, applying the lemma NENDP-IS-USUALLY-F, to:
T.
Case 4. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W)))
(NOT (NUMBERP (NTS+ N TS (PLUS TR R) W)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W)))
(NOT (LESSP 2 (NLST* N TS TR W R)))),
which simplifies, rewriting with PLUS-COMMUTES1, and expanding ZEROP and OR,
to:
T.
Case 3. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W)))
(LESSP (PLUS TR R)
(NTS+ N TS (PLUS TR R) W))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W)))
(NOT (LESSP 2 (NLST* N TS TR W R)))).
This simplifies, using linear arithmetic and applying NOT-LESSP-NTS+, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W)))
(NOT (LESSP (PLUS TR R)
(PLUS (NTS+ N TS (PLUS TR R) W) W)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W)))
(NOT (LESSP 2 (NLST* N TS TR W R)))),
which simplifies, applying the lemma PLUS-COMMUTES1, and unfolding the
definitions of ZEROP, OR, and NLST*, to:
(IMPLIES (AND (NOT (NENDP N TS (PLUS R TR) W))
(NOT (LESSP (PLUS R TR)
(PLUS W (NTS+ N TS (PLUS R TR) W))))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W)))
(NOT (LESSP 2
(NLST* (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R)))).
This again simplifies, using linear arithmetic and rewriting with LESSP-NTS+,
to:
T.
Case 1. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W)))
(NOT (LESSP 2
(NLST* (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R)))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W)))
(NOT (LESSP 2 (NLST* N TS TR W R)))).
This simplifies, appealing to the lemma PLUS-COMMUTES1, and unfolding ZEROP,
OR, and NLST*, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.1 0.0 ]
NOT-LESSP-2-NLST*
(PROVE-LEMMA SMOOTH-FLG-LISTN-NOT-FLG
(REWRITE)
(IMPLIES (AND (NOT (ZEROP N))
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG1 (LISTN N FLG2))
(CONS 'Q (LISTN (SUB1 N) FLG2))))
((ENABLE SMOOTH LISTN)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG1 (LISTN N FLG2))
(CONS 'Q (LISTN (SUB1 N) FLG2)))).
This simplifies, applying the lemmas CDR-CONS, B-XOR-COMMUTES, CAR-CONS, and
CONS-EQUAL, and opening up LISTN, SMOOTH, and EQUAL, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG2 (LISTN (SUB1 N) FLG2))
(LISTN (SUB1 N) FLG2))).
Applying the lemma SUB1-ELIM, replace N by (ADD1 X) to eliminate (SUB1 N). We
rely upon the type restriction lemma noted when SUB1 was introduced to
restrict the new variable. We would thus like to prove the new formula:
(IMPLIES (AND (NUMBERP X)
(NOT (EQUAL (ADD1 X) 0))
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG2 (LISTN X FLG2))
(LISTN X FLG2))),
which further simplifies, clearly, to the new conjecture:
(IMPLIES (AND (NUMBERP X) (B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG2 (LISTN X FLG2))
(LISTN X FLG2))),
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 (NOT (ZEROP N))
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG1 (LISTN N FLG2))
(CONS 'Q (LISTN (SUB1 N) FLG2)))).
We named this *1. We will try to prove it by induction. There is only one
suggested induction. We will induct according to the following scheme:
(AND (IMPLIES (ZEROP N) (p FLG1 N FLG2))
(IMPLIES (AND (NOT (ZEROP N))
(p FLG1 (SUB1 N) FLG2))
(p FLG1 N FLG2))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT N) decreases according to the well-founded relation
LESSP in each induction step of the scheme. The above induction scheme
produces two new formulas:
Case 2. (IMPLIES (AND (ZEROP (SUB1 N))
(NOT (ZEROP N))
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG1 (LISTN N FLG2))
(CONS 'Q (LISTN (SUB1 N) FLG2)))),
which simplifies, rewriting with CDR-CONS, B-XOR-COMMUTES, CAR-CONS,
LISTP-LISTN, and CONS-EQUAL, and unfolding ZEROP, LISTN, SMOOTH, EQUAL, CONS,
CAR, and CDR, to:
(IMPLIES (AND (EQUAL (SUB1 N) 0)
(NOT (EQUAL N 0))
(NUMBERP N)
(B-XOR FLG1 FLG2))
(EQUAL NIL (LISTN (SUB1 N) FLG2))),
which again simplifies, expanding the definitions of EQUAL and LISTN, to:
T.
Case 1. (IMPLIES (AND (EQUAL (SMOOTH FLG1 (LISTN (SUB1 N) FLG2))
(CONS 'Q
(LISTN (SUB1 (SUB1 N)) FLG2)))
(NOT (ZEROP N))
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG1 (LISTN N FLG2))
(CONS 'Q (LISTN (SUB1 N) FLG2)))),
which simplifies, appealing to the lemmas CDR-CONS, B-XOR-COMMUTES, CAR-CONS,
and CONS-EQUAL, and opening up the functions ZEROP, LISTN, SMOOTH, and EQUAL,
to:
(IMPLIES (AND (EQUAL (SMOOTH FLG1 (LISTN (SUB1 N) FLG2))
(CONS 'Q
(LISTN (SUB1 (SUB1 N)) FLG2)))
(NOT (EQUAL N 0))
(NUMBERP N)
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG2 (LISTN (SUB1 N) FLG2))
(LISTN (SUB1 N) FLG2))).
This further simplifies, rewriting with the lemmas CDR-CONS, B-XOR-X-X,
CAR-CONS, and CONS-EQUAL, and opening up the functions LISTN, SMOOTH, EQUAL,
and LISTP, to:
(IMPLIES (AND (NOT (EQUAL (SUB1 N) 0))
(EQUAL (SMOOTH FLG1
(CONS FLG2
(LISTN (SUB1 (SUB1 N)) FLG2)))
(CONS 'Q
(LISTN (SUB1 (SUB1 N)) FLG2)))
(NOT (EQUAL N 0))
(NUMBERP N)
(B-XOR FLG1 FLG2))
(EQUAL (SMOOTH FLG2
(LISTN (SUB1 (SUB1 N)) FLG2))
(LISTN (SUB1 (SUB1 N)) FLG2))).
However this again simplifies, applying CDR-CONS, B-XOR-COMMUTES, and
CAR-CONS, and expanding the functions SMOOTH and EQUAL, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
SMOOTH-FLG-LISTN-NOT-FLG
(DISABLE SMOOTH-FLG-LISTN-NOT-FLG)
[ 0.0 0.0 0.0 ]
SMOOTH-FLG-LISTN-NOT-FLG-OFF
(PROVE-LEMMA LST*-SMOOTH-CELL
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NOT (ZEROP M))
(NUMBERP N)
(LESSP 2 N)
(B-XOR FLG1 FLG2))
(EQUAL (LST* (SMOOTH FLG2 (CELL FLG1 M N BIT))
TS TR W R)
(LISTN (NLST* (PLUS M N) TS TR W R)
(CSIG FLG1 BIT))))
((ENABLE CSIG CELL SMOOTH-FLG-APP-LISTN-FLG
SMOOTH-FLG-APP-LISTN-NOT-FLG SMOOTH-FLG-LISTN-FLG
SMOOTH-FLG-LISTN-NOT-FLG)))
WARNING: the previously added lemma, LST*-IS-LASTN-NLST*, could be applied
whenever the newly proposed LST*-SMOOTH-CELL could!
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to the new goal:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NOT (EQUAL M 0))
(NUMBERP M)
(NUMBERP N)
(LESSP 2 N)
(B-XOR FLG1 FLG2))
(EQUAL (LST* (SMOOTH FLG2 (CELL FLG1 M N BIT))
TS TR W R)
(LISTN (NLST* (PLUS M N) TS TR W R)
(CSIG FLG1 BIT)))),
which simplifies, using linear arithmetic, rewriting with NOT-B-XOR-B-NOT,
B-XOR-COMMUTES, SMOOTH-FLG-APP-LISTN-FLG, LEN-LISTN, LEN-SMOOTH, LEN-APP,
NOT-LESSP-2-NLST*, LASTN-APP, and LST*-IS-LASTN-NLST*, and unfolding the
functions CSIG and CELL, to the following two new goals:
Case 2. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NOT (EQUAL M 0))
(NUMBERP M)
(NUMBERP N)
(LESSP 2 N)
(B-XOR FLG1 FLG2)
(NOT BIT))
(EQUAL (LASTN (NLST* (PLUS M N) TS TR W R)
(SMOOTH FLG2 (LISTN N (B-NOT FLG1))))
(LISTN (NLST* (PLUS M N) TS TR W R)
(B-NOT FLG1)))).
However this again simplifies, using linear arithmetic and applying
NOT-B-XOR-B-NOT, B-XOR-COMMUTES, SMOOTH-FLG-LISTN-FLG, NOT-LESSP-2-NLST*,
and LASTN-LISTN, to:
T.
Case 1. (IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NOT (EQUAL M 0))
(NUMBERP M)
(NUMBERP N)
(LESSP 2 N)
(B-XOR FLG1 FLG2)
BIT)
(EQUAL (LASTN (NLST* (PLUS M N) TS TR W R)
(SMOOTH FLG2 (LISTN N FLG1)))
(LISTN (NLST* (PLUS M N) TS TR W R)
FLG1))).
But this again simplifies, using linear arithmetic, rewriting with
B-XOR-COMMUTES, SMOOTH-FLG-LISTN-NOT-FLG, LASTN-LISTN, NOT-LESSP-2-NLST*,
CDR-CONS, LEN-LISTN, and ADD1-SUB1, and unfolding the functions LEN and
LASTN, to the following two new conjectures:
Case 1.2.
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NOT (EQUAL M 0))
(NUMBERP M)
(NUMBERP N)
(LESSP 2 N)
(B-XOR FLG1 FLG2)
BIT
(EQUAL N 0)
(EQUAL (NLST* (PLUS M N) TS TR W R)
1))
(EQUAL (CONS 'Q (LISTN (SUB1 N) FLG1))
(LISTN (NLST* (PLUS M N) TS TR W R)
FLG1))).
This again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(NOT (EQUAL M 0))
(NUMBERP M)
(NUMBERP N)
(LESSP 2 N)
(B-XOR FLG1 FLG2)
BIT
(NOT (EQUAL N 0))
(EQUAL (NLST* (PLUS M N) TS TR W R)
N))
(EQUAL (CONS 'Q (LISTN (SUB1 N) FLG1))
(LISTN (NLST* (PLUS M N) TS TR W R)
FLG1))),
which again simplifies, using linear arithmetic and rewriting with
NOT-LESSP-2-NLST*, to:
T.
Q.E.D.
[ 0.1 0.1 0.0 ]
LST*-SMOOTH-CELL
(DISABLE LST*-IS-LASTN-NLST*)
[ 0.0 0.0 0.0 ]
LST*-IS-LASTN-NLST*-OFF
(PROVE-LEMMA CDR-LISTN
(REWRITE)
(EQUAL (CDR (LISTN N FLG))
(IF (ZEROP N) 0 (LISTN (SUB1 N) FLG)))
((EXPAND (LISTN N FLG))))
This simplifies, unfolding the functions LISTN and ZEROP, to the following
three new formulas:
Case 3. (IMPLIES (NOT (NUMBERP N))
(EQUAL (CDR NIL) 0)).
But this again simplifies, opening up the functions CDR and EQUAL, to:
T.
Case 2. (IMPLIES (EQUAL N 0)
(EQUAL (CDR NIL) 0)),
which again simplifies, opening up the definitions of CDR and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL N 0)) (NUMBERP N))
(EQUAL (CDR (CONS FLG (LISTN (SUB1 N) FLG)))
(LISTN (SUB1 N) FLG))),
which again simplifies, rewriting with CDR-CONS, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CDR-LISTN
(DISABLE CDR-LISTN)
[ 0.0 0.0 0.0 ]
CDR-LISTN-OFF
(PROVE-LEMMA SMOOTH-APP-CELLS
(REWRITE)
(IMPLIES (AND (LISTP MSG) (NOT (ZEROP M)))
(EQUAL (SMOOTH FLG
(APP (CELLS FLG M N MSG)
(LISTN P2 T)))
(CONS 'Q
(SMOOTH (B-NOT FLG)
(APP (CDR (CELLS FLG M N MSG))
(LISTN P2 T))))))
((EXPAND (CELLS FLG M N MSG))
(ENABLE CELL SMOOTH-FLG-APP-LISTN-NOT-FLG
SMOOTH-FLG-LISTN-NOT-FLG CDR-APP CDR-LISTN
SMOOTH-FLG-APP-LISTN-FLG)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to the formula:
(IMPLIES (AND (LISTP MSG)
(NOT (EQUAL M 0))
(NUMBERP M))
(EQUAL (SMOOTH FLG
(APP (CELLS FLG M N MSG)
(LISTN P2 T)))
(CONS 'Q
(SMOOTH (B-NOT FLG)
(APP (CDR (CELLS FLG M N MSG))
(LISTN P2 T)))))).
This simplifies, rewriting with the lemmas APP-ASSOC, B-XOR-COMMUTES,
B-XOR-B-NOT, SMOOTH-FLG-LISTN-NOT-FLG, SMOOTH-FLG-APP-LISTN-NOT-FLG,
LISTP-LISTN, CDR-LISTN, CDR-APP, NOT-B-XOR-B-NOT, and SMOOTH-FLG-APP-LISTN-FLG,
and unfolding the definitions of CELLS and CELL, to the new goal:
(IMPLIES (AND (LISTP MSG)
(NOT (EQUAL M 0))
(NUMBERP M))
(EQUAL (APP (CONS 'Q
(LISTN (SUB1 M) (B-NOT FLG)))
(SMOOTH (B-NOT FLG)
(APP (LISTN N (CSIG FLG (CAR MSG)))
(APP (CELLS (CSIG FLG (CAR MSG))
M N
(CDR MSG))
(LISTN P2 T)))))
(CONS 'Q
(APP (LISTN (SUB1 M) (B-NOT FLG))
(SMOOTH (B-NOT FLG)
(APP (LISTN N (CSIG FLG (CAR MSG)))
(APP (CELLS (CSIG FLG (CAR MSG))
M N
(CDR MSG))
(LISTN P2 T)))))))),
which again simplifies, rewriting with CDR-CONS and CAR-CONS, and unfolding
the function APP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
SMOOTH-APP-CELLS
(PROVE-LEMMA LESSP-2-LEN-CDR-CELLS
(REWRITE)
(IMPLIES (LISTP MSG)
(LESSP 2
(LEN (CDR (CELLS FLG 5 13 MSG)))))
((EXPAND (CELLS FLG 5 13 MSG))))
WARNING: Note that the proposed lemma LESSP-2-LEN-CDR-CELLS is to be stored
as zero type prescription rules, zero compound recognizer rules, one linear
rule, and zero replacement rules.
This formula simplifies, rewriting with the lemmas CDR-APP-CELL-CELLS,
LEN-CELL, and LEN-APP, and expanding CELLS, EQUAL, SUB1, and PLUS, to the new
formula:
(IMPLIES (LISTP MSG)
(LESSP 2
(PLUS 17
(LEN (CELLS (CSIG FLG (CAR MSG))
5 13
(CDR MSG)))))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
LESSP-2-LEN-CDR-CELLS
(PROVE-LEMMA APP-LISTN-0
(REWRITE)
(EQUAL (APP (LISTN 0 FLG) REST) REST)
((ENABLE LISTN)))
This conjecture simplifies, opening up the functions EQUAL, LISTN, LISTP, and
APP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
APP-LISTN-0
(PROVE-LEMMA LOOP-KILLER-1A NIL
(IMPLIES
(AND (BVP MSG)
(LISTP MSG)
(LISTP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(B-XOR FLG1 FLG2))
(EQUAL
(RECV (LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(DET (TARGET (WARP (CDRN DW
(SMOOTH FLG2
(APP (CDR (CELLS FLG1 5 13 MSG))
(LISTN P2 T))))
TS TR W R))
ORACLE2)))
(RECV
(LEN MSG)
FLG1 10
(APP
(DET (LISTN NQ 'Q) ORACLE1)
(APP (DET (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2)
(APP (DET (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))
(DET (WARP (CDRN (DWG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(SMOOTH (B-NOT (CSIG FLG1 (CAR MSG)))
(APP (CDR (CELLS (CSIG FLG1 (CAR MSG))
5 13
(CDR MSG)))
(LISTN P2 T))))
(TSG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
W R)
(ORACLE* (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2)))))))))
((DISABLE LEN APP CELLS)
(ENABLE WARP-APP)
(EXPAND (CELLS FLG1 5 13 MSG))))
This conjecture can be simplified, using the abbreviations RATE-PROXIMITY,
ZEROP, NOT, AND, and IMPLIES, to:
(IMPLIES
(AND (BVP MSG)
(LISTP MSG)
(LISTP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(B-XOR FLG1 FLG2))
(EQUAL
(RECV
(LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(DET (TARGET (WARP (CDRN DW
(SMOOTH FLG2
(APP (CDR (CELLS FLG1 5 13 MSG))
(LISTN P2 T))))
TS TR W R))
ORACLE2)))
(RECV
(LEN MSG)
FLG1 10
(APP
(DET (LISTN NQ 'Q) ORACLE1)
(APP
(DET (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2)
(APP (DET (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))
(DET (WARP (CDRN (DWG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(SMOOTH (B-NOT (CSIG FLG1 (CAR MSG)))
(APP (CDR (CELLS (CSIG FLG1 (CAR MSG))
5 13
(CDR MSG)))
(LISTN P2 T))))
(TSG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
W R)
(ORACLE* (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))))))))).
This simplifies, using linear arithmetic, rewriting with CDR-APP-CELL-CELLS,
APP-ASSOC, B-XOR-COMMUTES, SMOOTH-APP-CELLS, SMOOTH-APP-CELL-APP-CELLS,
CDRN-DW-SMOOTH-CELL, CDRN-DW-APP-SMOOTH-CELL, PLUS-COMMUTES1,
ADD1-PLUS-12-DIFFERENCE-4-DW, LST*-SMOOTH-CELL, LEN-CELL, LEN-SMOOTH, LEN-TS*,
LEN-TR*, LESSP-2-LEN-CDR-CELLS, LEN-APP, LEN-LISTN, LESSP-NTR*-NTS*,
NOT-LESSP-NTR*-NTS*, NENDP-NLST*, APP-LISTN-0, WARP-APP-LISTN-Q, WARP-APP, and
DET-APP, and unfolding the functions BVP, SUB1, NUMBERP, EQUAL, TIMES, CELLS,
LESSP, PLUS, N*, NTR*, NTS*, NLST*, NQ, DW, TS, and TR, to:
T.
Q.E.D.
[ 0.0 0.8 0.0 ]
LOOP-KILLER-1A
(DISABLE CDR-APP-CELL-CELLS)
[ 0.0 0.0 0.0 ]
CDR-APP-CELL-CELLS-OFF
(DISABLE SMOOTH-APP-CELLS)
[ 0.0 0.0 0.0 ]
SMOOTH-APP-CELLS-OFF
(DISABLE SMOOTH-APP-CELL-APP-CELLS)
[ 0.0 0.0 0.0 ]
SMOOTH-APP-CELL-APP-CELLS-OFF
(DISABLE CDRN-DW-SMOOTH-CELL)
[ 0.0 0.0 0.0 ]
CDRN-DW-SMOOTH-CELL-OFF
(DISABLE CDRN-DW-APP-SMOOTH-CELL)
[ 0.0 0.0 0.0 ]
CDRN-DW-APP-SMOOTH-CELL-OFF
(DISABLE LST*-SMOOTH-CELL)
[ 0.0 0.0 0.0 ]
LST*-SMOOTH-CELL-OFF
(PROVE-LEMMA LOOP-KILLER-1
(REWRITE)
(IMPLIES
(AND (BVP MSG)
(LISTP MSG)
(LISTP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(B-XOR FLG1 FLG2))
(EQUAL
(RECV (LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(DET (WARP (CDRN DW
(SMOOTH FLG2
(APP (CDR (CELLS FLG1 5 13 MSG))
(LISTN P2 T))))
TS TR W R)
ORACLE2)))
(RECV
(LEN MSG)
FLG1 10
(APP
(DET (LISTN NQ 'Q) ORACLE1)
(APP (DET (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2)
(APP (DET (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))
(DET (WARP (CDRN (DWG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(SMOOTH (B-NOT (CSIG FLG1 (CAR MSG)))
(APP (CDR (CELLS (CSIG FLG1 (CAR MSG))
5 13
(CDR MSG)))
(LISTN P2 T))))
(TSG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
W R)
(ORACLE* (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2)))))))))
((ENABLE TARGET)
(USE (LOOP-KILLER-1A))))
This conjecture can be simplified, using the abbreviations RATE-PROXIMITY,
ZEROP, NOT, AND, IMPLIES, and TARGET, to:
(IMPLIES
(AND
(IMPLIES
(AND (BVP MSG)
(LISTP MSG)
(LISTP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(B-XOR FLG1 FLG2))
(EQUAL
(RECV (LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(DET (WARP (CDRN DW
(SMOOTH FLG2
(APP (CDR (CELLS FLG1 5 13 MSG))
(LISTN P2 T))))
TS TR W R)
ORACLE2)))
(RECV
(LEN MSG)
FLG1 10
(APP
(DET (LISTN NQ 'Q) ORACLE1)
(APP
(DET (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2)
(APP
(DET (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))
(DET (WARP (CDRN (DWG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(SMOOTH (B-NOT (CSIG FLG1 (CAR MSG)))
(APP (CDR (CELLS (CSIG FLG1 (CAR MSG))
5 13
(CDR MSG)))
(LISTN P2 T))))
(TSG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
W R)
(ORACLE* (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2)))))))))
(BVP MSG)
(LISTP MSG)
(LISTP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(B-XOR FLG1 FLG2))
(EQUAL
(RECV (LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(DET (WARP (CDRN DW
(SMOOTH FLG2
(APP (CDR (CELLS FLG1 5 13 MSG))
(LISTN P2 T))))
TS TR W R)
ORACLE2)))
(RECV
(LEN MSG)
FLG1 10
(APP
(DET (LISTN NQ 'Q) ORACLE1)
(APP
(DET (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2)
(APP (DET (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))
(DET (WARP (CDRN (DWG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(SMOOTH (B-NOT (CSIG FLG1 (CAR MSG)))
(APP (CDR (CELLS (CSIG FLG1 (CAR MSG))
5 13
(CDR MSG)))
(LISTN P2 T))))
(TSG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
W R)
(ORACLE* (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))))))))).
This simplifies, applying B-XOR-COMMUTES, SUB1-ADD1, CAR-CONS, and CONS-EQUAL,
and opening up the functions BVP, ZEROP, NOT, TIMES, EQUAL, NUMBERP, SUB1,
RATE-PROXIMITY, AND, LEN, CELLS, NTH, RECV, and IMPLIES, to:
T.
Q.E.D.
[ 0.0 1.2 0.0 ]
LOOP-KILLER-1
(DEFN LOOP-IND-HINT
(NQ ORACLE1 DW FLG2 FLG1 MSG TS TR W R ORACLE2)
(IF
(NLISTP MSG)
T
(IF (NLISTP (CDR MSG))
T
(LOOP-IND-HINT (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2)
(DWG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(B-NOT (CSIG FLG1 (CAR MSG)))
(CSIG FLG1 (CAR MSG))
(CDR MSG)
(TSG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
W R
(ORACLE* (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))))))
WARNING: NQ and ORACLE1 are in the arglist but not in the body of the
definition of LOOP-IND-HINT.
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the
definition of NLISTP inform us that the measure (COUNT MSG) decreases
according to the well-founded relation LESSP in each recursive call. Hence,
LOOP-IND-HINT is accepted under the definitional principle. Note that:
(TRUEP (LOOP-IND-HINT NQ ORACLE1 DW FLG2 FLG1 MSG TS TR W R ORACLE2))
is a theorem.
[ 0.0 0.0 0.0 ]
LOOP-IND-HINT
(PROVE-LEMMA APP-LISTN-FLG-LISTN-FLG
(REWRITE)
(EQUAL (APP (LISTN M FLG) (LISTN N FLG))
(LISTN (PLUS M N) FLG))
((ENABLE LISTN)))
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 M) (p M FLG N))
(IMPLIES (AND (NOT (ZEROP M))
(p (SUB1 M) FLG N))
(p M FLG N))).
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 goals:
Case 2. (IMPLIES (ZEROP M)
(EQUAL (APP (LISTN M FLG) (LISTN N FLG))
(LISTN (PLUS M N) FLG))),
which simplifies, opening up the functions ZEROP, EQUAL, LISTN, LISTP, APP,
and PLUS, to two new formulas:
Case 2.2.
(IMPLIES (AND (EQUAL M 0) (NOT (NUMBERP N)))
(EQUAL (LISTN N FLG) (LISTN 0 FLG))),
which again simplifies, opening up LISTN and EQUAL, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP M))
(NOT (NUMBERP N)))
(EQUAL (LISTN N FLG) (LISTN 0 FLG))),
which again simplifies, opening up the definitions of LISTN and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP M))
(EQUAL (APP (LISTN (SUB1 M) FLG)
(LISTN N FLG))
(LISTN (PLUS (SUB1 M) N) FLG)))
(EQUAL (APP (LISTN M FLG) (LISTN N FLG))
(LISTN (PLUS M N) FLG))),
which simplifies, applying the lemmas CDR-CONS, CAR-CONS, and SUB1-ADD1, and
expanding ZEROP, LISTN, APP, and PLUS, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
APP-LISTN-FLG-LISTN-FLG
(PROVE-LEMMA CDRN-LISTN
(REWRITE)
(IMPLIES (NOT (LESSP N DW))
(EQUAL (CDRN DW (LISTN N FLG))
(LISTN (DIFFERENCE N DW) FLG)))
((ENABLE LISTN)))
.
Applying the lemma DIFFERENCE-ELIM, replace N by (PLUS DW X) to eliminate
(DIFFERENCE N DW). We employ the type restriction lemma noted when DIFFERENCE
was introduced to restrict the new variable. This produces the following two
new conjectures:
Case 2. (IMPLIES (AND (NOT (NUMBERP N))
(NOT (LESSP N DW)))
(EQUAL (CDRN DW (LISTN N FLG))
(LISTN (DIFFERENCE N DW) FLG))).
But this simplifies, using linear arithmetic, rewriting with the lemma
DIFFERENCE-IS-0, and unfolding the functions LESSP, LISTN, CDRN, and EQUAL,
to:
T.
Case 1. (IMPLIES (AND (NUMBERP X)
(NOT (LESSP (PLUS DW X) DW)))
(EQUAL (CDRN DW (LISTN (PLUS DW X) FLG))
(LISTN X FLG))),
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 (NOT (LESSP N DW))
(EQUAL (CDRN DW (LISTN N FLG))
(LISTN (DIFFERENCE N DW) FLG))).
We named this *1. We will try to prove it by induction. There are six
plausible inductions. However, they merge into one likely candidate induction.
We will induct according to the following scheme:
(AND (IMPLIES (OR (EQUAL DW 0) (NOT (NUMBERP DW)))
(p DW N FLG))
(IMPLIES (AND (NOT (OR (EQUAL DW 0) (NOT (NUMBERP DW))))
(OR (EQUAL N 0) (NOT (NUMBERP N))))
(p DW N FLG))
(IMPLIES (AND (NOT (OR (EQUAL DW 0) (NOT (NUMBERP DW))))
(NOT (OR (EQUAL N 0) (NOT (NUMBERP N))))
(p (SUB1 DW) (SUB1 N) FLG))
(p DW N FLG))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT establish that the measure (COUNT N) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for DW. The above induction scheme
generates four new goals:
Case 4. (IMPLIES (AND (OR (EQUAL DW 0) (NOT (NUMBERP DW)))
(NOT (LESSP N DW)))
(EQUAL (CDRN DW (LISTN N FLG))
(LISTN (DIFFERENCE N DW) FLG))),
which simplifies, expanding the definitions of NOT, OR, EQUAL, LESSP, LISTN,
CDRN, and DIFFERENCE, to six new goals:
Case 4.6.
(IMPLIES (AND (EQUAL DW 0)
(NOT (EQUAL N 0))
(NUMBERP N))
(EQUAL (CONS FLG (LISTN (SUB1 N) FLG))
(LISTN N FLG))),
which again simplifies, expanding the definition of LISTN, to:
T.
Case 4.5.
(IMPLIES (AND (EQUAL DW 0) (EQUAL N 0))
(EQUAL NIL (LISTN 0 FLG))),
which again simplifies, opening up the functions EQUAL and LISTN, to:
T.
Case 4.4.
(IMPLIES (AND (EQUAL DW 0) (NOT (NUMBERP N)))
(EQUAL NIL (LISTN 0 FLG))),
which again simplifies, expanding EQUAL and LISTN, to:
T.
Case 4.3.
(IMPLIES (AND (NOT (NUMBERP DW))
(NOT (EQUAL N 0))
(NUMBERP N))
(EQUAL (CONS FLG (LISTN (SUB1 N) FLG))
(LISTN N FLG))),
which again simplifies, expanding the definition of LISTN, to:
T.
Case 4.2.
(IMPLIES (AND (NOT (NUMBERP DW)) (EQUAL N 0))
(EQUAL NIL (LISTN 0 FLG))),
which again simplifies, expanding the definitions of EQUAL and LISTN, to:
T.
Case 4.1.
(IMPLIES (AND (NOT (NUMBERP DW))
(NOT (NUMBERP N)))
(EQUAL NIL (LISTN 0 FLG))),
which again simplifies, expanding the functions EQUAL and LISTN, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (EQUAL DW 0) (NOT (NUMBERP DW))))
(OR (EQUAL N 0) (NOT (NUMBERP N)))
(NOT (LESSP N DW)))
(EQUAL (CDRN DW (LISTN N FLG))
(LISTN (DIFFERENCE N DW) FLG))),
which simplifies, unfolding the definitions of NOT, OR, EQUAL, and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL DW 0) (NOT (NUMBERP DW))))
(NOT (OR (EQUAL N 0) (NOT (NUMBERP N))))
(LESSP (SUB1 N) (SUB1 DW))
(NOT (LESSP N DW)))
(EQUAL (CDRN DW (LISTN N FLG))
(LISTN (DIFFERENCE N DW) FLG))),
which simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP DW 1)
(NOT (OR (EQUAL DW 0) (NOT (NUMBERP DW))))
(NOT (OR (EQUAL N 0) (NOT (NUMBERP N))))
(LESSP (SUB1 N) (SUB1 DW))
(NOT (LESSP N DW)))
(EQUAL (CDRN DW (LISTN N FLG))
(LISTN (DIFFERENCE N DW) FLG))).
But this again simplifies, unfolding SUB1, NUMBERP, EQUAL, LESSP, NOT, and
OR, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL DW 0) (NOT (NUMBERP DW))))
(NOT (OR (EQUAL N 0) (NOT (NUMBERP N))))
(EQUAL (CDRN (SUB1 DW) (LISTN (SUB1 N) FLG))
(LISTN (DIFFERENCE (SUB1 N) (SUB1 DW))
FLG))
(NOT (LESSP N DW)))
(EQUAL (CDRN DW (LISTN N FLG))
(LISTN (DIFFERENCE N DW) FLG))),
which simplifies, rewriting with CDR-CONS, and opening up the functions NOT,
OR, LESSP, LISTN, CDRN, and DIFFERENCE, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
CDRN-LISTN
(PROVE-LEMMA WARP-SMOOTH-CELL
(REWRITE)
(IMPLIES (AND (BOOLP BIT)
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(NUMBERP M)
(NUMBERP N)
(LESSP 3 N)
(B-XOR FLG1 FLG2))
(EQUAL (WARP (SMOOTH FLG2 (CELL FLG1 M N BIT))
TS TR W R)
(IF BIT
(APP (LISTN (N* M TS TR W R) (B-NOT FLG1))
(APP (LISTN (NQG (NLST* M TS TR W R)
(NTS* M TS TR W R)
(NTR* M TS TR W R)
W R)
'Q)
(LISTN (N* (DIFFERENCE (SUB1 N)
(DWG (NLST* M TS TR W R)
(NTS* M TS TR W R)
(NTR* M TS TR W R)
W R))
(TSG (NLST* M TS TR W R)
(NTS* M TS TR W R)
(NTR* M TS TR W R)
W R)
(TRG (NLST* M TS TR W R)
(NTS* M TS TR W R)
(NTR* M TS TR W R)
W R)
W R)
FLG1)))
(LISTN (N* (PLUS M N) TS TR W R)
(B-NOT FLG1)))))
((DO-NOT-INDUCT T)
(ENABLE CELL CSIG SMOOTH-FLG-APP-LISTN-FLG SMOOTH-FLG-APP-LISTN-NOT-FLG
SMOOTH-FLG-LISTN-FLG SMOOTH-FLG-LISTN-NOT-FLG WARP-LISTN)))
This formula can be simplified, using the abbreviations RATE-PROXIMITY, ZEROP,
NOT, AND, and IMPLIES, to the new conjecture:
(IMPLIES
(AND (BOOLP BIT)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(NUMBERP M)
(NUMBERP N)
(LESSP 3 N)
(B-XOR FLG1 FLG2))
(EQUAL (WARP (SMOOTH FLG2 (CELL FLG1 M N BIT))
TS TR W R)
(IF BIT
(APP (LISTN (N* M TS TR W R) (B-NOT FLG1))
(APP (LISTN (NQG (NLST* M TS TR W R)
(NTS* M TS TR W R)
(NTR* M TS TR W R)
W R)
'Q)
(LISTN (N* (DIFFERENCE (SUB1 N)
(DWG (NLST* M TS TR W R)
(NTS* M TS TR W R)
(NTR* M TS TR W R)
W R))
(TSG (NLST* M TS TR W R)
(NTS* M TS TR W R)
(NTR* M TS TR W R)
W R)
(TRG (NLST* M TS TR W R)
(NTS* M TS TR W R)
(NTR* M TS TR W R)
W R)
W R)
FLG1)))
(LISTN (N* (PLUS M N) TS TR W R)
(B-NOT FLG1))))),
which simplifies, rewriting with NOT-B-XOR-B-NOT, B-XOR-COMMUTES, and
SMOOTH-FLG-APP-LISTN-FLG, and unfolding SUB1, NUMBERP, EQUAL, TIMES, CSIG, and
CELL, to the following two new conjectures:
Case 2. (IMPLIES (AND (BOOLP BIT)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP M)
(NUMBERP N)
(LESSP 3 N)
(B-XOR FLG1 FLG2)
(NOT BIT))
(EQUAL (WARP (APP (LISTN M (B-NOT FLG1))
(SMOOTH FLG2 (LISTN N (B-NOT FLG1))))
TS TR W R)
(LISTN (N* (PLUS M N) TS TR W R)
(B-NOT FLG1)))).
But this again simplifies, applying NOT-B-XOR-B-NOT, B-XOR-COMMUTES,
SMOOTH-FLG-LISTN-FLG, APP-LISTN-FLG-LISTN-FLG, and WARP-LISTN, and opening
up the function BOOLP, to:
T.
Case 1. (IMPLIES
(AND (BOOLP BIT)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP M)
(NUMBERP N)
(LESSP 3 N)
(B-XOR FLG1 FLG2)
BIT)
(EQUAL (WARP (APP (LISTN M (B-NOT FLG1))
(SMOOTH FLG2 (LISTN N FLG1)))
TS TR W R)
(APP (LISTN (N* M TS TR W R) (B-NOT FLG1))
(APP (LISTN (NQG (NLST* M TS TR W R)
(NTS* M TS TR W R)
(NTR* M TS TR W R)
W R)
'Q)
(LISTN (N* (DIFFERENCE (SUB1 N)
(DWG (NLST* M TS TR W R)
(NTS* M TS TR W R)
(NTR* M TS TR W R)
W R))
(TSG (NLST* M TS TR W R)
(NTS* M TS TR W R)
(NTR* M TS TR W R)
W R)
(TRG (NLST* M TS TR W R)
(NTS* M TS TR W R)
(NTR* M TS TR W R)
W R)
W R)
FLG1))))).
But this again simplifies, using linear arithmetic, applying the lemmas
B-XOR-COMMUTES, SMOOTH-FLG-LISTN-NOT-FLG, LEN-LISTN, DWG-BOUNDS, CDRN-LISTN,
LESSP-TRG*-PLUS-W-TSG*, PLUS-COMMUTES1, NOT-LESSP-TRG*-TSG*, WARP-LISTN, and
WARP-APP-LISTN-Q, and opening up the definitions of NQ, DW, TS, and TR, to:
T.
Q.E.D.
[ 0.0 1.1 0.0 ]
WARP-SMOOTH-CELL
(PROVE-LEMMA NENDP-ALG
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR+)
(NOT (ZEROP W))
(LESSP TS TR+))
(EQUAL (NENDP N TS TR+ W)
(LESSP (PLUS TS (TIMES N W)) TR+))))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to:
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+))
(EQUAL (NENDP N TS TR+ W)
(LESSP (PLUS TS (TIMES N W)) TR+))).
Give the above formula the name *1.
We will appeal to induction. Six 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 N) (p N TS TR+ W))
(IMPLIES (AND (NOT (ZEROP N))
(LESSP (PLUS TS W) TR+)
(p (SUB1 N) (PLUS TS W) TR+ W))
(p N TS TR+ W))
(IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP (PLUS TS W) TR+)))
(p N TS TR+ W))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT N) decreases according to the well-founded
relation LESSP in each induction step of the scheme. Note, however, the
inductive instance chosen for TS. The above induction scheme generates the
following three new formulas:
Case 3. (IMPLIES (AND (ZEROP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+))
(EQUAL (NENDP N TS TR+ W)
(LESSP (PLUS TS (TIMES N W)) TR+))).
This simplifies, rewriting with PLUS-COMMUTES1, and opening up ZEROP, EQUAL,
NENDP, TIMES, and PLUS, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(LESSP (PLUS TS W) TR+)
(EQUAL (NENDP (SUB1 N) (PLUS TS W) TR+ W)
(LESSP (PLUS (PLUS TS W) (TIMES (SUB1 N) W))
TR+))
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+))
(EQUAL (NENDP N TS TR+ W)
(LESSP (PLUS TS (TIMES N W)) TR+))),
which simplifies, applying PLUS-ASSOCIATES, and unfolding the functions
ZEROP, NENDP, and TIMES, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP (PLUS TS W) TR+))
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+))
(EQUAL (NENDP N TS TR+ W)
(LESSP (PLUS TS (TIMES N W)) TR+))).
This simplifies, expanding the functions ZEROP, NENDP, and TIMES, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (PLUS TS W) TR+))
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+))
(NOT (LESSP (PLUS TS W (TIMES (SUB1 N) W))
TR+))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
NENDP-ALG
(PROVE-LEMMA NLST+-TS-PLUS-TS-W
(REWRITE)
(IMPLIES (AND (NUMBERP N) (NOT (ZEROP W)))
(EQUAL (NLST+ N TS (PLUS TS W) W)
(SUB1 N)))
((EXPAND (NLST+ N TS (PLUS TS W) W)
(NLST+ (SUB1 N)
(PLUS TS W)
(PLUS TS W)
W))))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to the new formula:
(IMPLIES (AND (NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W))
(EQUAL (NLST+ N TS (PLUS TS W) W)
(SUB1 N))),
which simplifies, appealing to the lemma PLUS-ASSOCIATES, and unfolding the
function NLST+, to four new goals:
Case 4. (IMPLIES (AND (NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL N 0))
(LESSP (PLUS TS W) (PLUS TS W)))
(EQUAL N (SUB1 N))),
which again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES (AND (NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL N 0))
(NOT (LESSP (PLUS TS W) (PLUS TS W)))
(NOT (EQUAL (SUB1 N) 0))
(NOT (LESSP (PLUS TS W) (PLUS TS W W))))
(EQUAL (NLST+ (SUB1 (SUB1 N))
(PLUS TS W W)
(PLUS TS W)
W)
(SUB1 N))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(EQUAL N 0))
(EQUAL 0 (SUB1 N))),
which again simplifies, expanding NUMBERP, SUB1, and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NUMBERP N)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS W) (PLUS TS W)))
(EQUAL (SUB1 N) 0))
(EQUAL 0 (SUB1 N))),
which again simplifies, clearly, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NLST+-TS-PLUS-TS-W
(PROVE-LEMMA NLST+-ALG
(REWRITE)
(IMPLIES (AND (NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (ZEROP W))
(LESSP TS TR+))
(EQUAL (NLST+ N TS TR+ W)
(DIFFERENCE N
(QUOTIENT (DIFFERENCE TR+ TS) W)))))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+))
(EQUAL (NLST+ N TS TR+ W)
(DIFFERENCE N
(QUOTIENT (DIFFERENCE TR+ TS) W)))).
Applying the lemmas REMAINDER-QUOTIENT-ELIM and DIFFERENCE-ELIM, replace TR+
by (PLUS TS X) to eliminate (DIFFERENCE TR+ TS), X by (PLUS V (TIMES W Z)) to
eliminate (QUOTIENT X W) and (REMAINDER X W), and N by (PLUS Z X) to eliminate
(DIFFERENCE N Z). We use LESSP-REMAINDER, the type restriction lemma noted
when QUOTIENT was introduced, the type restriction lemma noted when REMAINDER
was introduced, and the type restriction lemma noted when DIFFERENCE was
introduced to restrict the new variables. This produces the following three
new goals:
Case 3. (IMPLIES (AND (LESSP TR+ TS)
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+))
(EQUAL (NLST+ N TS TR+ W)
(DIFFERENCE N
(QUOTIENT (DIFFERENCE TR+ TS) W)))).
This simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (LESSP N Z)
(NUMBERP Z)
(NUMBERP V)
(EQUAL (LESSP V W) (NOT (ZEROP W)))
(NOT (LESSP (PLUS TS V (TIMES W Z)) TS))
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS (PLUS TS V (TIMES W Z))))
(EQUAL (NLST+ N TS (PLUS TS V (TIMES W Z)) W)
(DIFFERENCE N Z))),
which simplifies, using linear arithmetic, rewriting with the lemma
DIFFERENCE-IS-0, and opening up the definitions of ZEROP and NOT, to the
formula:
(IMPLIES (AND (LESSP N Z)
(NUMBERP Z)
(NUMBERP V)
(LESSP V W)
(NOT (LESSP (PLUS TS V (TIMES W Z)) TS))
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS (PLUS TS V (TIMES W Z))))
(EQUAL (NLST+ N TS (PLUS TS V (TIMES W Z)) W)
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 (AND (NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (ZEROP W))
(LESSP TS TR+))
(EQUAL (NLST+ N TS TR+ W)
(DIFFERENCE N
(QUOTIENT (DIFFERENCE TR+ TS) W)))),
which we named *1 above. We will appeal to induction. There are six
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 N) (p N TS TR+ W))
(IMPLIES (AND (NOT (ZEROP N))
(LESSP TR+ (PLUS TS W)))
(p N TS TR+ W))
(IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP TR+ (PLUS TS W)))
(p (SUB1 N) (PLUS TS W) TR+ W))
(p N TS TR+ W))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to establish that the measure (COUNT N) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for TS. The above induction scheme
produces four new conjectures:
Case 4. (IMPLIES (AND (ZEROP N)
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (ZEROP W))
(LESSP TS TR+))
(EQUAL (NLST+ N TS TR+ W)
(DIFFERENCE N
(QUOTIENT (DIFFERENCE TR+ TS) W)))),
which simplifies, using linear arithmetic, rewriting with the lemma
DIFFERENCE-IS-0, and unfolding the definitions of ZEROP, NUMBERP, EQUAL, and
NLST+, to:
T.
Case 3. (IMPLIES (AND (NOT (ZEROP N))
(LESSP TR+ (PLUS TS W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (ZEROP W))
(LESSP TS TR+))
(EQUAL (NLST+ N TS TR+ W)
(DIFFERENCE N
(QUOTIENT (DIFFERENCE TR+ TS) W)))),
which simplifies, using linear arithmetic, rewriting with
DIFFERENCE-DIFFERENCE-OTHER and DIFFERENCE-IS-0, and expanding the functions
ZEROP, NLST+, QUOTIENT, LESSP, EQUAL, and ADD1, to the following two new
formulas:
Case 3.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(LESSP TR+ (PLUS TS W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+)
(NOT (LESSP (DIFFERENCE TR+ TS) W)))
(EQUAL N (DIFFERENCE N 1))).
But this again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP TR+ TS)
(NOT (EQUAL N 0))
(LESSP TR+ (PLUS TS W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+)
(NOT (LESSP (DIFFERENCE TR+ TS) W)))
(EQUAL N (DIFFERENCE N 1))).
But this again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(LESSP TR+ (PLUS TS W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+)
(LESSP (DIFFERENCE TR+ TS) W))
(EQUAL N (DIFFERENCE N 0))),
which again simplifies, using linear arithmetic, to:
(IMPLIES (AND (LESSP N 0)
(NOT (EQUAL N 0))
(LESSP TR+ (PLUS TS W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+)
(LESSP (DIFFERENCE TR+ TS) W))
(EQUAL N (DIFFERENCE N 0))).
But this again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP TR+ (PLUS TS W)))
(NOT (LESSP (PLUS TS W) TR+))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (ZEROP W))
(LESSP TS TR+))
(EQUAL (NLST+ N TS TR+ W)
(DIFFERENCE N
(QUOTIENT (DIFFERENCE TR+ TS) W)))),
which simplifies, using linear arithmetic, to:
(IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP (PLUS W TS) (PLUS TS W)))
(NOT (LESSP (PLUS TS W) (PLUS W TS)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP (PLUS W TS))
(NOT (ZEROP W))
(LESSP TS (PLUS W TS)))
(EQUAL (NLST+ N TS (PLUS W TS) W)
(DIFFERENCE N
(QUOTIENT (DIFFERENCE (PLUS W TS) TS)
W)))).
This again simplifies, rewriting with PLUS-COMMUTES1, NLST+-TS-PLUS-TS-W,
DIFFERENCE-PLUS-CANCELLATION1, and QUOTIENT-X-X, and unfolding the
definition of ZEROP, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NOT (LESSP (PLUS TS W) (PLUS TS W)))
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS (PLUS TS W)))
(EQUAL (SUB1 N) (DIFFERENCE N 1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP TR+ (PLUS TS W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
(DIFFERENCE (SUB1 N)
(QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (ZEROP W))
(LESSP TS TR+))
(EQUAL (NLST+ N TS TR+ W)
(DIFFERENCE N
(QUOTIENT (DIFFERENCE TR+ TS) W)))),
which simplifies, applying the lemma DIFFERENCE-DIFFERENCE-OTHER, and
opening up ZEROP, NLST+, and QUOTIENT, to two new goals:
Case 1.2.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NOT (LESSP TR+ (PLUS TS W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
(DIFFERENCE (SUB1 N)
(QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+)
(NOT (LESSP (DIFFERENCE TR+ TS) W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
(DIFFERENCE N
(ADD1 (QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W))))),
which again simplifies, using linear arithmetic, to two new formulas:
Case 1.2.2.
(IMPLIES
(AND (LESSP (SUB1 N)
(QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W))
(NOT (EQUAL N 0))
(NOT (LESSP TR+ (PLUS TS W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
(DIFFERENCE (SUB1 N)
(QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+)
(NOT (LESSP (DIFFERENCE TR+ TS) W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
(DIFFERENCE N
(ADD1 (QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W))))),
which again simplifies, using linear arithmetic and rewriting with
DIFFERENCE-IS-0, to the new conjecture:
(IMPLIES
(AND (LESSP (SUB1 N)
(QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W))
(NOT (EQUAL N 0))
(NOT (LESSP TR+ (PLUS TS W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
(DIFFERENCE (SUB1 N)
(QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+)
(NOT (LESSP (DIFFERENCE TR+ TS) W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
0)),
which further simplifies, using linear arithmetic and rewriting with
DIFFERENCE-IS-0, to:
T.
Case 1.2.1.
(IMPLIES
(AND (LESSP N
(ADD1 (QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W)))
(NOT (EQUAL N 0))
(NOT (LESSP TR+ (PLUS TS W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
(DIFFERENCE (SUB1 N)
(QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+)
(NOT (LESSP (DIFFERENCE TR+ TS) W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
(DIFFERENCE N
(ADD1 (QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W))))).
But this again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (LESSP (SUB1 N)
(QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W))
(LESSP N
(ADD1 (QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W)))
(NOT (EQUAL N 0))
(NOT (LESSP TR+ (PLUS TS W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
(DIFFERENCE (SUB1 N)
(QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+)
(NOT (LESSP (DIFFERENCE TR+ TS) W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
(DIFFERENCE N
(ADD1 (QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W))))).
But this again simplifies, using linear arithmetic, appealing to the
lemmas SUB1-ADD1, LESSP-QUOTIENT-TO-LESSP-TIMES, TIMES-MONOTONIC,
NOT-LESSP-TIMES-QUOTIENT, TIMES-COMMUTES1, and DIFFERENCE-IS-0, and
expanding LESSP, to the formula:
(IMPLIES
(AND (LESSP (SUB1 N)
(QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W))
(NOT (EQUAL N 0))
(NOT (LESSP TR+ (PLUS TS W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
(DIFFERENCE (SUB1 N)
(QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+)
(NOT (LESSP (DIFFERENCE TR+ TS) W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
0)).
But this further simplifies, using linear arithmetic and applying the
lemma DIFFERENCE-IS-0, to:
T.
Case 1.1.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NOT (LESSP TR+ (PLUS TS W)))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
(DIFFERENCE (SUB1 N)
(QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(LESSP TS TR+)
(LESSP (DIFFERENCE TR+ TS) W))
(EQUAL (NLST+ (SUB1 N) (PLUS TS W) TR+ W)
(DIFFERENCE N 0))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.1 0.2 0.0 ]
NLST+-ALG
(DISABLE NLST+-TS-PLUS-TS-W)
[ 0.0 0.0 0.0 ]
NLST+-TS-PLUS-TS-W-OFF
(PROVE-LEMMA NOT-LESSP-NTS+-TS
(REWRITE)
(NOT (LESSP (NTS+ N TS TR+ W) TS)))
WARNING: Note that the proposed lemma NOT-LESSP-NTS+-TS is to be stored as
zero type prescription rules, zero compound recognizer rules, one linear rule,
and zero replacement rules.
Call the conjecture *1.
We will try to prove it by induction. The recursive terms in the
conjecture suggest two inductions. However, only one is unflawed. We will
induct according to the following scheme:
(AND (IMPLIES (ZEROP N) (p N TS TR+ W))
(IMPLIES (AND (NOT (ZEROP N))
(LESSP TR+ (PLUS TS W)))
(p N TS TR+ W))
(IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP TR+ (PLUS TS W)))
(p (SUB1 N) (PLUS TS W) TR+ W))
(p N TS TR+ W))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to establish that the measure (COUNT N) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for TS. The above induction scheme
generates the following three new formulas:
Case 3. (IMPLIES (ZEROP N)
(NOT (LESSP (NTS+ N TS TR+ W) TS))).
This simplifies, expanding the definitions of ZEROP, EQUAL, and NTS+, to the
following two new conjectures:
Case 3.2.
(IMPLIES (EQUAL N 0)
(NOT (LESSP TS TS))).
But this again simplifies, using linear arithmetic, to:
T.
Case 3.1.
(IMPLIES (NOT (NUMBERP N))
(NOT (LESSP TS TS))),
which again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(LESSP TR+ (PLUS TS W)))
(NOT (LESSP (NTS+ N TS TR+ W) TS))),
which simplifies, unfolding the definitions of ZEROP and NTS+, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP TR+ (PLUS TS W)))
(NOT (LESSP TS TS))).
This again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP TR+ (PLUS TS W)))
(NOT (LESSP (NTS+ (SUB1 N) (PLUS TS W) TR+ W)
(PLUS TS W))))
(NOT (LESSP (NTS+ N TS TR+ W) TS))),
which simplifies, opening up the definitions of ZEROP and NTS+, to the goal:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP TR+ (PLUS TS W)))
(NOT (LESSP (NTS+ (SUB1 N) (PLUS TS W) TR+ W)
(PLUS TS W))))
(NOT (LESSP (NTS+ (SUB1 N) (PLUS TS W) TR+ W)
TS))).
This again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
NOT-LESSP-NTS+-TS
(PROVE-LEMMA NTS+-ALG
(REWRITE)
(IMPLIES (AND (NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (ZEROP W))
(NOT (LESSP TR+ TS)))
(EQUAL (NTS+ N TS TR+ W)
(IF (LESSP (PLUS TS (TIMES N W)) TR+)
(PLUS TS (TIMES N W))
(PLUS TS
(TIMES W
(QUOTIENT (DIFFERENCE TR+ TS) W)))))))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to the new conjecture:
(IMPLIES (AND (NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR+ TS)))
(EQUAL (NTS+ N TS TR+ W)
(IF (LESSP (PLUS TS (TIMES N W)) TR+)
(PLUS TS (TIMES N W))
(PLUS TS
(TIMES W
(QUOTIENT (DIFFERENCE TR+ TS) W)))))),
which simplifies, obviously, to the following two new formulas:
Case 2. (IMPLIES (AND (NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR+ TS))
(NOT (LESSP (PLUS TS (TIMES N W)) TR+)))
(EQUAL (NTS+ N TS TR+ W)
(PLUS TS
(TIMES W
(QUOTIENT (DIFFERENCE TR+ TS) W))))).
Appealing to the lemmas DIFFERENCE-ELIM and REMAINDER-QUOTIENT-ELIM, we now
replace TR+ by (PLUS TS X) to eliminate (DIFFERENCE TR+ TS) and X by
(PLUS V (TIMES W Z)) to eliminate (QUOTIENT X W) and (REMAINDER X W). 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 constrain the new variables. The result is:
(IMPLIES (AND (NUMBERP Z)
(NUMBERP V)
(EQUAL (LESSP V W) (NOT (ZEROP W)))
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS V (TIMES W Z)) TS))
(NOT (LESSP (PLUS TS (TIMES N W))
(PLUS TS V (TIMES W Z)))))
(EQUAL (NTS+ N TS (PLUS TS V (TIMES W Z)) W)
(PLUS TS (TIMES W Z)))).
This further simplifies, opening up the functions ZEROP and NOT, to the
conjecture:
(IMPLIES (AND (NUMBERP Z)
(NUMBERP V)
(LESSP V W)
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS V (TIMES W Z)) TS))
(NOT (LESSP (PLUS TS (TIMES N W))
(PLUS TS V (TIMES W Z)))))
(EQUAL (NTS+ N TS (PLUS TS V (TIMES W Z)) W)
(PLUS TS (TIMES W Z)))),
which we would usually push and work on later by induction. But if we must
use induction to prove the input conjecture, we prefer to induct on the
original formulation of the problem. Thus we will disregard all that we
have previously done, give the name *1 to the original input, and work on it.
So now let us consider:
(IMPLIES (AND (NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (ZEROP W))
(NOT (LESSP TR+ TS)))
(EQUAL (NTS+ N TS TR+ W)
(IF (LESSP (PLUS TS (TIMES N W)) TR+)
(PLUS TS (TIMES N W))
(PLUS TS
(TIMES W
(QUOTIENT (DIFFERENCE TR+ TS) W)))))).
We gave this the name *1 above. Perhaps we can prove it by induction. 12
inductions are suggested by terms in the conjecture. They merge into three
likely candidate inductions. However, only one is unflawed. We will induct
according to the following scheme:
(AND (IMPLIES (ZEROP N) (p N TS TR+ W))
(IMPLIES (AND (NOT (ZEROP N))
(LESSP TR+ (PLUS TS W)))
(p N TS TR+ W))
(IMPLIES (AND (NOT (ZEROP N))
(NOT (LESSP TR+ (PLUS TS W)))
(p (SUB1 N) (PLUS TS W) TR+ W))
(p N TS TR+ W))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT N) decreases according to the well-founded relation
LESSP in each induction step of the scheme. Note, however, the inductive
instance chosen for TS. The above induction scheme generates the following
three new conjectures:
Case 3. (IMPLIES (AND (ZEROP N)
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (ZEROP W))
(NOT (LESSP TR+ TS)))
(EQUAL (NTS+ N TS TR+ W)
(IF (LESSP (PLUS TS (TIMES N W)) TR+)
(PLUS TS (TIMES N W))
(PLUS TS
(TIMES W
(QUOTIENT (DIFFERENCE TR+ TS) W)))))).
This simplifies, rewriting with PLUS-COMMUTES1, DIFFERENCE-IS-0, and
TIMES-COMMUTES1, and unfolding ZEROP, NUMBERP, EQUAL, NTS+, TIMES, PLUS,
LESSP, and QUOTIENT, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(LESSP TR+ (PLUS TS W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (ZEROP W))
(NOT (LESSP TR+ TS)))
(EQUAL (NTS+ N TS TR+ W)
(IF (LESSP (PLUS TS (TIMES N W)) TR+)
(PLUS TS (TIMES N W))
(PLUS TS
(TIMES W
(QUOTIENT (DIFFERENCE TR+ TS) W)))))),
which simplifies, using linear arithmetic, applying the lemmas
DIFFERENCE-DIFFERENCE-OTHER and DIFFERENCE-IS-0, and opening up the
functions ZEROP, NTS+, TIMES, QUOTIENT, LESSP, EQUAL, and ADD1, to three new
formulas:
Case 2.3.
(IMPLIES (AND (NOT (EQUAL N 0))
(LESSP TR+ (PLUS TS W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR+ TS))
(NOT (LESSP (PLUS TS W (TIMES (SUB1 N) W))
TR+))
(LESSP (DIFFERENCE TR+ TS) W))
(EQUAL TS (PLUS TS (TIMES W 0)))),
which again simplifies, rewriting with TIMES-COMMUTES1 and PLUS-COMMUTES1,
and expanding EQUAL, TIMES, and PLUS, to:
T.
Case 2.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(LESSP TR+ (PLUS TS W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR+ TS))
(NOT (LESSP (PLUS TS W (TIMES (SUB1 N) W))
TR+))
(NOT (LESSP (DIFFERENCE TR+ TS) W)))
(EQUAL TS (PLUS TS (TIMES W 1)))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(LESSP TR+ (PLUS TS W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR+ TS))
(LESSP (PLUS TS W (TIMES (SUB1 N) W))
TR+))
(EQUAL TS
(PLUS TS W (TIMES (SUB1 N) W)))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES
(AND (NOT (ZEROP N))
(NOT (LESSP TR+ (PLUS TS W)))
(EQUAL (NTS+ (SUB1 N) (PLUS TS W) TR+ W)
(IF (LESSP (PLUS (PLUS TS W) (TIMES (SUB1 N) W))
TR+)
(PLUS (PLUS TS W) (TIMES (SUB1 N) W))
(PLUS (PLUS TS W)
(TIMES W
(QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W)))))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (ZEROP W))
(NOT (LESSP TR+ TS)))
(EQUAL (NTS+ N TS TR+ W)
(IF (LESSP (PLUS TS (TIMES N W)) TR+)
(PLUS TS (TIMES N W))
(PLUS TS
(TIMES W
(QUOTIENT (DIFFERENCE TR+ TS) W)))))),
which simplifies, applying PLUS-ASSOCIATES and DIFFERENCE-DIFFERENCE-OTHER,
and unfolding the functions ZEROP, NTS+, TIMES, and QUOTIENT, to the
following two new formulas:
Case 1.2.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NOT (LESSP TR+ (PLUS TS W)))
(NOT (LESSP (PLUS TS W (TIMES (SUB1 N) W))
TR+))
(EQUAL (NTS+ (SUB1 N) (PLUS TS W) TR+ W)
(PLUS TS W
(TIMES W
(QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W))))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR+ TS))
(NOT (LESSP (DIFFERENCE TR+ TS) W)))
(EQUAL (NTS+ (SUB1 N) (PLUS TS W) TR+ W)
(PLUS TS
(TIMES W
(ADD1 (QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W)))))).
This again simplifies, appealing to the lemma TIMES-ADD1, to:
T.
Case 1.1.
(IMPLIES
(AND (NOT (EQUAL N 0))
(NOT (LESSP TR+ (PLUS TS W)))
(NOT (LESSP (PLUS TS W (TIMES (SUB1 N) W))
TR+))
(EQUAL (NTS+ (SUB1 N) (PLUS TS W) TR+ W)
(PLUS TS W
(TIMES W
(QUOTIENT (DIFFERENCE TR+ (PLUS TS W))
W))))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR+)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR+ TS))
(LESSP (DIFFERENCE TR+ TS) W))
(EQUAL (NTS+ (SUB1 N) (PLUS TS W) TR+ W)
(PLUS TS (TIMES W 0)))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.2 0.0 ]
NTS+-ALG
(PROVE-LEMMA N*-ALG-LEMMA
(REWRITE)
(IMPLIES
(AND (NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS R TS X) W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP W)
(NOT (EQUAL W 0))
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL (ADD1 (QUOTIENT (DIFFERENCE (TIMES W (NLST+ N TS (PLUS R TS X) W))
(DIFFERENCE (PLUS R TS X)
(NTS+ N TS (PLUS R TS X) W)))
R))
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R))))
This simplifies, using linear arithmetic and rewriting with NENDP-ALG,
DIFFERENCE-PLUS-CANCELLATION3, NLST+-ALG, NTS+-ALG,
DIFFERENCE-PLUS-CANCELLATION-4, NOT-LESSP-TIMES-QUOTIENT, PLUS-COMMUTES1, and
DIFFERENCE-DIFFERENCE, to the new goal:
(IMPLIES
(AND (NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS (TIMES N W))
(PLUS R TS X)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP W)
(NOT (EQUAL W 0))
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL
(ADD1
(QUOTIENT
(DIFFERENCE (PLUS (TIMES W (QUOTIENT (PLUS R X) W))
(TIMES W
(DIFFERENCE N
(QUOTIENT (PLUS R X) W))))
(PLUS R X))
R))
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R))).
Applying the lemma DIFFERENCE-ELIM, replace N by:
(PLUS (QUOTIENT (PLUS R X) W) Z)
to eliminate (DIFFERENCE N (QUOTIENT (PLUS R X) W)). We rely upon the type
restriction lemma noted when DIFFERENCE was introduced to restrict the new
variable. We would thus like to prove the following two new conjectures:
Case 2. (IMPLIES
(AND (LESSP N (QUOTIENT (PLUS R X) W))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS (TIMES N W))
(PLUS R TS X)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP W)
(NOT (EQUAL W 0))
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL
(ADD1
(QUOTIENT
(DIFFERENCE (PLUS (TIMES W (QUOTIENT (PLUS R X) W))
(TIMES W
(DIFFERENCE N
(QUOTIENT (PLUS R X) W))))
(PLUS R X))
R))
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R))).
But this further simplifies, rewriting with NSIG*-ALG-LEMMA-HACK1, to:
T.
Case 1. (IMPLIES
(AND (NUMBERP Z)
(NOT (LESSP (PLUS (QUOTIENT (PLUS R X) W) Z)
(QUOTIENT (PLUS R X) W)))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS
(TIMES (PLUS (QUOTIENT (PLUS R X) W) Z)
W))
(PLUS R TS X)))
(NUMBERP TS)
(NUMBERP W)
(NOT (EQUAL W 0))
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL
(ADD1 (QUOTIENT (DIFFERENCE (PLUS (TIMES W (QUOTIENT (PLUS R X) W))
(TIMES W Z))
(PLUS R X))
R))
(QUOTIENT (DIFFERENCE (TIMES (PLUS (QUOTIENT (PLUS R X) W) Z)
W)
X)
R))).
However this further simplifies, rewriting with PLUS-COMMUTES1,
TIMES-COMMUTES1, and TIMES-DISTRIBUTES2, to:
(IMPLIES
(AND (NUMBERP Z)
(NOT (LESSP (PLUS Z (QUOTIENT (PLUS R X) W))
(QUOTIENT (PLUS R X) W)))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS
(TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R TS X)))
(NUMBERP TS)
(NUMBERP W)
(NOT (EQUAL W 0))
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL
(ADD1 (QUOTIENT (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R X))
R))
(QUOTIENT (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
X)
R))),
which again simplifies, rewriting with the lemmas
DIFFERENCE-DIFFERENCE-OTHER and PLUS-COMMUTES1, and expanding QUOTIENT, to:
(IMPLIES
(AND (NUMBERP Z)
(NOT (LESSP (PLUS Z (QUOTIENT (PLUS R X) W))
(QUOTIENT (PLUS R X) W)))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS
(TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R TS X)))
(NUMBERP TS)
(NUMBERP W)
(NOT (EQUAL W 0))
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W))
(LESSP (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
X)
R))
(EQUAL
(ADD1 (QUOTIENT (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R X))
R))
0)).
However this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.6 0.0 ]
N*-ALG-LEMMA
(DISABLE NSIG*-ALG-LEMMA-HACK1)
[ 0.0 0.0 0.0 ]
NSIG*-ALG-LEMMA-HACK1-OFF
(PROVE-LEMMA N*-ALG-HACK1
(REWRITE)
(IMPLIES (AND (NENDP N TS (PLUS R TR) W)
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NUMBERP W)
(NOT (EQUAL W 0))
(NUMBERP R)
(NOT (EQUAL R 0))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES N W)
(DIFFERENCE TR TS))))
(EQUAL (LESSP (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R)
T)))
This simplifies, using linear arithmetic and applying NENDP-ALG,
PLUS-COMMUTES1, and DIFFERENCE-DIFFERENCE, to the new goal:
(IMPLIES (AND (LESSP (PLUS TS (TIMES N W))
(PLUS R TR))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NUMBERP W)
(NOT (EQUAL W 0))
(NUMBERP R)
(NOT (EQUAL R 0))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES N W)
(DIFFERENCE TR TS))))
(LESSP (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)),
which again simplifies, using linear arithmetic, to the goal:
(IMPLIES (AND (LESSP (PLUS TS (TIMES N W)) TR)
(LESSP (PLUS TS (TIMES N W))
(PLUS R TR))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NUMBERP W)
(NOT (EQUAL W 0))
(NUMBERP R)
(NOT (EQUAL R 0))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES N W)
(DIFFERENCE TR TS))))
(LESSP (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)).
But this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
N*-ALG-HACK1
(PROVE-LEMMA N*-ALG
(REWRITE)
(IMPLIES (AND (NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(EQUAL (N* N TS TR W R)
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R)))
((DISABLE NENDP-ALG NTS+-ALG NLST+-ALG
DIFFERENCE-DIFFERENCE-OTHER DIFFERENCE-DIFFERENCE)))
This formula can be simplified, using the abbreviations ZEROP, NOT, AND, and
IMPLIES, to:
(IMPLIES (AND (NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(EQUAL (N* N TS TR W R)
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R))).
Applying the lemma DIFFERENCE-ELIM, replace TR by (PLUS TS X) to eliminate
(DIFFERENCE TR TS). We rely upon the type restriction lemma noted when
DIFFERENCE was introduced to restrict the new variable. We thus obtain:
(IMPLIES (AND (NUMBERP X)
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL (N* N TS (PLUS TS X) W R)
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R))),
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 (NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(EQUAL (N* N TS TR W R)
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R))),
named *1. Let us appeal to the induction principle. The recursive terms in
the conjecture suggest eight inductions. They merge into three likely
candidate inductions, all 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 (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W))
(p N TS TR W R))
(IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W)))
(p (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R))
(p N TS TR W R))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, SUB1-ADD1, NLST+-EQUAL-N,
ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LESSP-NLST+, and the definitions
of LISTP, ORDINALP, NLST+, LESSP, ORD-LESSP, EQUAL, OR, ZEROP, NTS+, and NENDP
inform us that the measure:
(CONS (CONS (ADD1 N) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each induction
step of the scheme. The above induction scheme leads to six new conjectures:
Case 6. (IMPLIES (AND (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(EQUAL (N* N TS TR W R)
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R))),
which simplifies, using linear arithmetic, rewriting with the lemmas
PLUS-COMMUTES1, DIFFERENCE-IS-0, and
LESSP-PLUS-NTS*-TIMES-W-NLST*-PLUS-R-NTR*-LEMMA, and unfolding ZEROP, OR, N*,
QUOTIENT, LESSP, EQUAL, and ADD1, to two new conjectures:
Case 6.2.
(IMPLIES (AND (NENDP N TS (PLUS R TR) W)
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP (TIMES N W)
(DIFFERENCE TR TS)))
(EQUAL (N* N TS TR W R)
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R))),
which again simplifies, using linear arithmetic, rewriting with
PLUS-COMMUTES1 and DIFFERENCE-IS-0, and opening up the definitions of N*,
LESSP, EQUAL, and QUOTIENT, to:
T.
Case 6.1.
(IMPLIES (AND (NENDP N TS (PLUS R TR) W)
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES N W)
(DIFFERENCE TR TS))))
(LESSP (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R)).
This again simplifies, appealing to the lemma N*-ALG-HACK1, to:
T.
Case 5. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W)))
(NOT (NUMBERP (NLST+ N TS (PLUS TR R) W)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(EQUAL (N* N TS TR W R)
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R))),
which simplifies, applying PLUS-COMMUTES1, and unfolding ZEROP and OR, to:
T.
Case 4. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W)))
(NOT (NUMBERP (NTS+ N TS (PLUS TR R) W)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(EQUAL (N* N TS TR W R)
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R))).
This simplifies, rewriting with PLUS-COMMUTES1, and unfolding the
definitions of ZEROP and OR, to:
T.
Case 3. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W)))
(LESSP (PLUS TR R)
(NTS+ N TS (PLUS TR R) W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(EQUAL (N* N TS TR W R)
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R))),
which simplifies, applying PLUS-COMMUTES1, and unfolding the definitions of
ZEROP, OR, and N*, to the new formula:
(IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS R TR) W))
(LESSP (PLUS R TR)
(NTS+ N TS (PLUS R TR) W))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(EQUAL (ADD1 (N* (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R))
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R))),
which again simplifies, using linear arithmetic and rewriting with
NOT-LESSP-NTS+, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W)))
(NOT (LESSP (PLUS TR R)
(PLUS (NTS+ N TS (PLUS TR R) W) W)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(EQUAL (N* N TS TR W R)
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R))).
This simplifies, applying PLUS-COMMUTES1, and unfolding the functions ZEROP,
OR, and N*, to:
(IMPLIES (AND (NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS R TR) W))
(NOT (LESSP (PLUS R TR)
(PLUS W (NTS+ N TS (PLUS R TR) W))))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(EQUAL (ADD1 (N* (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R))
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R))).
However this again simplifies, using linear arithmetic and applying the
lemmas LESSP-NTS+ and NOT-LESSP-NTS+-TS, to:
T.
Case 1. (IMPLIES
(AND
(NOT (OR (ZEROP R)
(NENDP N TS (PLUS TR R) W)))
(EQUAL (N* (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R)
(QUOTIENT (DIFFERENCE (TIMES (NLST+ N TS (PLUS TR R) W) W)
(DIFFERENCE (PLUS TR R)
(NTS+ N TS (PLUS TR R) W)))
R))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(EQUAL (N* N TS TR W R)
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R))),
which simplifies, applying PLUS-COMMUTES1 and TIMES-COMMUTES1, and unfolding
the functions ZEROP, OR, and N*, to the new conjecture:
(IMPLIES
(AND
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS R TR) W))
(EQUAL (N* (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R)
(QUOTIENT (DIFFERENCE (TIMES W (NLST+ N TS (PLUS R TR) W))
(DIFFERENCE (PLUS R TR)
(NTS+ N TS (PLUS R TR) W)))
R))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(EQUAL (ADD1 (N* (NLST+ N TS (PLUS TR R) W)
(NTS+ N TS (PLUS TR R) W)
(PLUS TR R)
W R))
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R))),
which further simplifies, rewriting with PLUS-COMMUTES1, to:
(IMPLIES
(AND
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS R TR) W))
(EQUAL (N* (NLST+ N TS (PLUS R TR) W)
(NTS+ N TS (PLUS R TR) W)
(PLUS R TR)
W R)
(QUOTIENT (DIFFERENCE (TIMES W (NLST+ N TS (PLUS R TR) W))
(DIFFERENCE (PLUS R TR)
(NTS+ N TS (PLUS R TR) W)))
R))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W)))
(EQUAL (ADD1 (N* (NLST+ N TS (PLUS R TR) W)
(NTS+ N TS (PLUS R TR) W)
(PLUS R TR)
W R))
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R))).
Applying the lemma DIFFERENCE-ELIM, replace TR by (PLUS TS X) to eliminate
(DIFFERENCE TR TS). We employ the type restriction lemma noted when
DIFFERENCE was introduced to restrict the new variable. This produces:
(IMPLIES
(AND
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS R TS X) W))
(EQUAL
(N* (NLST+ N TS (PLUS R TS X) W)
(NTS+ N TS (PLUS R TS X) W)
(PLUS R TS X)
W R)
(QUOTIENT (DIFFERENCE (TIMES W (NLST+ N TS (PLUS R TS X) W))
(DIFFERENCE (PLUS R TS X)
(NTS+ N TS (PLUS R TS X) W)))
R))
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL (ADD1 (N* (NLST+ N TS (PLUS R TS X) W)
(NTS+ N TS (PLUS R TS X) W)
(PLUS R TS X)
W R))
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R))).
We use the above equality hypothesis by substituting:
(QUOTIENT (DIFFERENCE (TIMES W (NLST+ N TS (PLUS R TS X) W))
(DIFFERENCE (PLUS R TS X)
(NTS+ N TS (PLUS R TS X) W)))
R)
for:
(N* (NLST+ N TS (PLUS R TS X) W)
(NTS+ N TS (PLUS R TS X) W)
(PLUS R TS X)
W R)
and throwing away the equality. We must thus prove:
(IMPLIES
(AND (NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS R TS X) W))
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL
(ADD1 (QUOTIENT (DIFFERENCE (TIMES W (NLST+ N TS (PLUS R TS X) W))
(DIFFERENCE (PLUS R TS X)
(NTS+ N TS (PLUS R TS X) W)))
R))
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R))).
This further simplifies, applying the lemma N*-ALG-LEMMA, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 1.1 0.0 ]
N*-ALG
(DISABLE N*-ALG-HACK1)
[ 0.0 0.0 0.0 ]
N*-ALG-HACK1-OFF
(DISABLE N*-ALG)
[ 0.0 0.0 0.0 ]
N*-ALG-OFF
(DISABLE N*-ALG-LEMMA)
[ 0.0 0.0 0.0 ]
N*-ALG-LEMMA-OFF
(DISABLE NTS+-ALG)
[ 0.0 0.0 0.0 ]
NTS+-ALG-OFF
(DISABLE NLST+-ALG)
[ 0.0 0.0 0.0 ]
NLST+-ALG-OFF
(DISABLE NENDP-ALG)
[ 0.0 0.0 0.0 ]
NENDP-ALG-OFF
(DISABLE NSIG*-UPPER-BOUND-HACK1)
[ 0.0 0.0 0.0 ]
NSIG*-UPPER-BOUND-HACK1-OFF
(DISABLE NSIG*-UPPER-BOUND-HACK2)
[ 0.0 0.0 0.0 ]
NSIG*-UPPER-BOUND-HACK2-OFF
(DISABLE NSIG*-UPPER-BOUND-HACK3)
[ 0.0 0.0 0.0 ]
NSIG*-UPPER-BOUND-HACK3-OFF
(DISABLE NSIG*-UPPER-BOUND-LEMMA2-EQUALITY)
[ 0.0 0.0 0.0 ]
NSIG*-UPPER-BOUND-LEMMA2-EQUALITY-OFF
(PROVE-LEMMA N*-UPPER-BOUND
(REWRITE)
(IMPLIES (AND (NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(LESSP N 18))
(NOT (LESSP N (N* N TS TR W R))))
((DISABLE PLUS-COMMUTES1 DIFFERENCE-DIFFERENCE)
(ENABLE N*-ALG)))
WARNING: Note that the proposed lemma N*-UPPER-BOUND is to be stored as zero
type prescription rules, zero compound recognizer rules, one linear rule, and
zero replacement rules.
This formula can be simplified, using the abbreviations RATE-PROXIMITY, ZEROP,
NOT, AND, and IMPLIES, to:
(IMPLIES (AND (NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(NOT (LESSP N (N* N TS TR W R)))),
which simplifies, applying N*-ALG, and unfolding the definitions of SUB1,
NUMBERP, EQUAL, and TIMES, to the new formula:
(IMPLIES (AND (NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(LESSP N 18))
(NOT (LESSP N
(QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R)))),
which again simplifies, using linear arithmetic, applying
NSIG*-UPPER-BOUND-LEMMA2 and NSIG*-UPPER-BOUND-LEMMA1, and opening up TIMES,
EQUAL, NUMBERP, SUB1, and RATE-PROXIMITY, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
N*-UPPER-BOUND
(DISABLE NSIG*-UPPER-BOUND-LEMMA1)
[ 0.0 0.0 0.0 ]
NSIG*-UPPER-BOUND-LEMMA1-OFF
(DISABLE NSIG*-UPPER-BOUND-LEMMA2)
[ 0.0 0.0 0.0 ]
NSIG*-UPPER-BOUND-LEMMA2-OFF
(PROVE-LEMMA N*-LOWER-BOUND
(REWRITE)
(IMPLIES (AND (NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(LESSP N 18))
(NOT (LESSP (N* N TS TR W R)
(SUB1 (SUB1 N)))))
((DISABLE NSIG*-LOWER-BOUND-LEMMA1 LESSP-QUOTIENT-TO-LESSP-TIMES
QUOTIENT TIMES PLUS DIFFERENCE LESSP)
(USE (NSIG*-LOWER-BOUND-LEMMA1 (TR-TS (DIFFERENCE TR TS)))
(NSIG*-UPPER-BOUND-LEMMA2-EQUALITY (N (SUB1 N))))
(ENABLE N*-ALG)))
WARNING: Note that the proposed lemma N*-LOWER-BOUND is to be stored as zero
type prescription rules, zero compound recognizer rules, one linear rule, and
zero replacement rules.
This conjecture can be simplified, using the abbreviations RATE-PROXIMITY,
ZEROP, NOT, IMPLIES, and AND, to:
(IMPLIES
(AND (IMPLIES (AND (NOT (ZEROP R))
(NOT (LESSP W (DIFFERENCE TR TS))))
(NOT (LESSP (QUOTIENT (DIFFERENCE (TIMES N W)
(DIFFERENCE TR TS))
R)
(QUOTIENT (TIMES (SUB1 N) W) R))))
(IMPLIES (AND (NUMBERP (SUB1 N))
(NOT (ZEROP W))
(NOT (ZEROP R))
(RATE-PROXIMITY W R)
(LESSP (SUB1 N) 18))
(EQUAL (QUOTIENT (TIMES (SUB1 N) W) R)
(IF (LESSP W R)
(SUB1 (SUB1 N))
(SUB1 N))))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(NOT (LESSP (N* N TS TR W R)
(SUB1 (SUB1 N))))).
This simplifies, rewriting with PLUS-COMMUTES1, DIFFERENCE-DIFFERENCE,
TIMES-COMMUTES1, and N*-ALG, and opening up the functions ZEROP, NOT, AND,
IMPLIES, and RATE-PROXIMITY, to six new goals:
Case 6. (IMPLIES (AND (LESSP W (DIFFERENCE TR TS))
(NOT (LESSP (SUB1 N) 18))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(SUB1 (SUB1 N))))),
which again simplifies, using linear arithmetic, to the formula:
(IMPLIES (AND (EQUAL N 0)
(LESSP W (DIFFERENCE TR TS))
(NOT (LESSP (SUB1 N) 18))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(SUB1 (SUB1 N))))).
However this again simplifies, using linear arithmetic, to:
T.
Case 5. (IMPLIES (AND (LESSP W (DIFFERENCE TR TS))
(NOT (LESSP W R))
(EQUAL (QUOTIENT (TIMES W (SUB1 N)) R)
(SUB1 N))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(SUB1 (SUB1 N))))),
which again simplifies, using linear arithmetic, to:
T.
Case 4. (IMPLIES (AND (LESSP W (DIFFERENCE TR TS))
(LESSP W R)
(EQUAL (QUOTIENT (TIMES W (SUB1 N)) R)
(SUB1 (SUB1 N)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(SUB1 (SUB1 N))))),
which again simplifies, using linear arithmetic, to:
T.
Case 3. (IMPLIES
(AND (NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(QUOTIENT (TIMES W (SUB1 N)) R)))
(NOT (LESSP (SUB1 N) 18))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(SUB1 (SUB1 N))))),
which again simplifies, using linear arithmetic, to:
(IMPLIES
(AND (EQUAL N 0)
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(QUOTIENT (TIMES W (SUB1 N)) R)))
(NOT (LESSP (SUB1 N) 18))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(SUB1 (SUB1 N))))).
However this again simplifies, using linear arithmetic, applying
DIFFERENCE-IS-0, TIMES-COMMUTES1, and QUOTIENT-MONOTONIC, and expanding the
definitions of SUB1 and LESSP, to:
T.
Case 2. (IMPLIES
(AND (NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(QUOTIENT (TIMES W (SUB1 N)) R)))
(NOT (LESSP W R))
(EQUAL (QUOTIENT (TIMES W (SUB1 N)) R)
(SUB1 N))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(SUB1 (SUB1 N))))).
But this again simplifies, using linear arithmetic, to two new conjectures:
Case 2.2.
(IMPLIES
(AND (EQUAL (SUB1 N) 0)
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(QUOTIENT (TIMES W (SUB1 N)) R)))
(NOT (LESSP W R))
(EQUAL (QUOTIENT (TIMES W (SUB1 N)) R)
(SUB1 N))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(SUB1 (SUB1 N))))),
which again simplifies, rewriting with TIMES-COMMUTES1, and opening up the
function SUB1, to:
T.
Case 2.1.
(IMPLIES
(AND (EQUAL N 0)
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(QUOTIENT (TIMES W (SUB1 N)) R)))
(NOT (LESSP W R))
(EQUAL (QUOTIENT (TIMES W (SUB1 N)) R)
(SUB1 N))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(SUB1 (SUB1 N))))).
However this again simplifies, using linear arithmetic, applying
DIFFERENCE-IS-0, TIMES-COMMUTES1, and QUOTIENT-MONOTONIC, and opening up
the definitions of SUB1, NUMBERP, and LESSP, to:
(IMPLIES (AND (NOT (LESSP W R))
(EQUAL (QUOTIENT (TIMES 0 W) R) 0)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W))))
(NOT (LESSP (QUOTIENT 0 R) 0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES
(AND (NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(QUOTIENT (TIMES W (SUB1 N)) R)))
(LESSP W R)
(EQUAL (QUOTIENT (TIMES W (SUB1 N)) R)
(SUB1 (SUB1 N)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(SUB1 (SUB1 N))))),
which again simplifies, using linear arithmetic, to two new goals:
Case 1.2.
(IMPLIES
(AND (EQUAL (SUB1 N) 0)
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(QUOTIENT (TIMES W (SUB1 N)) R)))
(LESSP W R)
(EQUAL (QUOTIENT (TIMES W (SUB1 N)) R)
(SUB1 (SUB1 N)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(SUB1 (SUB1 N))))),
which again simplifies, using linear arithmetic, rewriting with
TIMES-COMMUTES1, LESSP-TIMES, QUOTIENT-MONOTONIC, and DIFFERENCE-IS-0, and
expanding SUB1, NUMBERP, and LESSP, to the following two new conjectures:
Case 1.2.2.
(IMPLIES
(AND (EQUAL (SUB1 N) 0)
(EQUAL N 0)
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(QUOTIENT (TIMES W 0) R)))
(LESSP W R)
(EQUAL (QUOTIENT (TIMES 0 W) R) 0)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W))))
(NOT (LESSP (QUOTIENT 0 R) 0))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.2.1.
(IMPLIES
(AND (EQUAL (SUB1 N) 0)
(NOT (EQUAL N 0))
(LESSP W R)
(EQUAL (QUOTIENT (TIMES 0 W) R) 0)
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
0))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES
(AND (EQUAL N 0)
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(QUOTIENT (TIMES W (SUB1 N)) R)))
(LESSP W R)
(EQUAL (QUOTIENT (TIMES W (SUB1 N)) R)
(SUB1 (SUB1 N)))
(NUMBERP N)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(LESSP N 18))
(NOT (LESSP (QUOTIENT (DIFFERENCE (PLUS TS (TIMES N W)) TR)
R)
(SUB1 (SUB1 N))))),
which again simplifies, using linear arithmetic, applying DIFFERENCE-IS-0,
TIMES-COMMUTES1, and QUOTIENT-MONOTONIC, and unfolding the functions SUB1,
NUMBERP, and LESSP, to the new conjecture:
(IMPLIES (AND (LESSP W R)
(EQUAL (QUOTIENT (TIMES 0 W) R) 0)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W))))
(NOT (LESSP (QUOTIENT 0 R) 0))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
N*-LOWER-BOUND
(DISABLE NSIG*-LOWER-BOUND-LEMMA1)
[ 0.0 0.0 0.0 ]
NSIG*-LOWER-BOUND-LEMMA1-OFF
(PROVE-LEMMA LEN-DET
(REWRITE)
(EQUAL (LEN (DET LST ORACLE))
(LEN LST))
((ENABLE DET)))
Call the conjecture *1.
We will try to 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 (NLISTP LST) (p LST ORACLE))
(IMPLIES (AND (NOT (NLISTP LST))
(EQUAL (CAR LST) 'Q)
(p (CDR LST) (CDR ORACLE)))
(p LST ORACLE))
(IMPLIES (AND (NOT (NLISTP LST))
(NOT (EQUAL (CAR LST) 'Q))
(p (CDR LST) ORACLE))
(p LST ORACLE))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to establish that the measure (COUNT LST) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. Note, however, the inductive instances chosen for ORACLE. The above
induction scheme generates the following three new formulas:
Case 3. (IMPLIES (NLISTP LST)
(EQUAL (LEN (DET LST ORACLE))
(LEN LST))).
This simplifies, expanding the definitions of NLISTP, DET, LEN, and EQUAL,
to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST))
(EQUAL (CAR LST) 'Q)
(EQUAL (LEN (DET (CDR LST) (CDR ORACLE)))
(LEN (CDR LST))))
(EQUAL (LEN (DET LST ORACLE))
(LEN LST))).
This simplifies, opening up the functions NLISTP, DET, EQUAL, and LEN, to
the following two new formulas:
Case 2.2.
(IMPLIES (AND (LISTP LST)
(EQUAL (CAR LST) 'Q)
(EQUAL (LEN (DET (CDR LST) (CDR ORACLE)))
(LEN (CDR LST)))
(NOT (CAR ORACLE)))
(EQUAL (LEN (CONS F (DET (CDR LST) (CDR ORACLE))))
(ADD1 (LEN (CDR LST))))).
This again simplifies, rewriting with CDR-CONS, and expanding the
definition of LEN, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP LST)
(EQUAL (CAR LST) 'Q)
(EQUAL (LEN (DET (CDR LST) (CDR ORACLE)))
(LEN (CDR LST)))
(CAR ORACLE))
(EQUAL (LEN (CONS T (DET (CDR LST) (CDR ORACLE))))
(ADD1 (LEN (CDR LST))))).
This again simplifies, appealing to the lemma CDR-CONS, and opening up the
definition of LEN, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST))
(NOT (EQUAL (CAR LST) 'Q))
(EQUAL (LEN (DET (CDR LST) ORACLE))
(LEN (CDR LST))))
(EQUAL (LEN (DET LST ORACLE))
(LEN LST))),
which simplifies, applying the lemma CDR-CONS, and expanding the definitions
of NLISTP, DET, and LEN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LEN-DET
(DEFN DET-LISTN-HINT
(NQ ORACLE)
(IF (ZEROP NQ)
T
(DET-LISTN-HINT (SUB1 NQ)
(CDR ORACLE))))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT NQ) decreases according to the well-founded
relation LESSP in each recursive call. Hence, DET-LISTN-HINT is accepted
under the principle of definition. Observe that:
(TRUEP (DET-LISTN-HINT NQ ORACLE))
is a theorem.
[ 0.0 0.0 0.0 ]
DET-LISTN-HINT
(DEFN NO
(FLG NQ ORACLE)
(IF (ZEROP NQ)
0
(IF (B-XOR FLG (CAR ORACLE))
NQ
(NO FLG (SUB1 NQ) (CDR ORACLE)))))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
establish that the measure (COUNT NQ) decreases according to the well-founded
relation LESSP in each recursive call. Hence, NO is accepted under the
definitional principle. From the definition we can conclude that:
(NUMBERP (NO FLG NQ ORACLE))
is a theorem.
[ 0.0 0.0 0.0 ]
NO
(PROVE-LEMMA NO-IS-LEN-SCAN-DET-LISTN NIL
(IMPLIES (NUMBERP NQ)
(EQUAL (NO FLG NQ ORACLE)
(LEN (SCAN FLG
(DET (LISTN NQ 'Q) ORACLE)))))
((ENABLE LISTN DET SCAN B-XOR)))
Give the conjecture the name *1.
We will appeal to induction. Two inductions are suggested by terms in
the conjecture. However, they merge into one likely candidate induction. We
will induct according to the following scheme:
(AND (IMPLIES (ZEROP NQ) (p FLG NQ ORACLE))
(IMPLIES (AND (NOT (ZEROP NQ))
(B-XOR FLG (CAR ORACLE)))
(p FLG NQ ORACLE))
(IMPLIES (AND (NOT (ZEROP NQ))
(NOT (B-XOR FLG (CAR ORACLE)))
(p FLG (SUB1 NQ) (CDR ORACLE)))
(p FLG NQ ORACLE))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to establish that the measure (COUNT NQ) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for ORACLE. The above induction scheme
leads to three new goals:
Case 3. (IMPLIES (AND (ZEROP NQ) (NUMBERP NQ))
(EQUAL (NO FLG NQ ORACLE)
(LEN (SCAN FLG
(DET (LISTN NQ 'Q) ORACLE))))),
which simplifies, unfolding the functions ZEROP, NUMBERP, EQUAL, NO, LISTN,
LISTP, DET, SCAN, and LEN, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP NQ))
(B-XOR FLG (CAR ORACLE))
(NUMBERP NQ))
(EQUAL (NO FLG NQ ORACLE)
(LEN (SCAN FLG
(DET (LISTN NQ 'Q) ORACLE))))),
which simplifies, rewriting with the lemmas B-XOR-COMMUTES, CDR-CONS,
CAR-CONS, LEN-LISTN, LEN-DET, and ADD1-SUB1, and opening up ZEROP, B-XOR, NO,
LISTN, EQUAL, DET, SCAN, and LEN, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP NQ))
(NOT (B-XOR FLG (CAR ORACLE)))
(EQUAL (NO FLG (SUB1 NQ) (CDR ORACLE))
(LEN (SCAN FLG
(DET (LISTN (SUB1 NQ) 'Q)
(CDR ORACLE)))))
(NUMBERP NQ))
(EQUAL (NO FLG NQ ORACLE)
(LEN (SCAN FLG
(DET (LISTN NQ 'Q) ORACLE))))),
which simplifies, rewriting with the lemmas CDR-CONS and CAR-CONS, and
expanding ZEROP, B-XOR, LISTN, EQUAL, DET, SCAN, and NO, to:
(IMPLIES (AND (NOT (EQUAL NQ 0))
(NOT FLG)
(NOT (CAR ORACLE))
(EQUAL (NO FLG (SUB1 NQ) (CDR ORACLE))
(LEN (SCAN F
(DET (LISTN (SUB1 NQ) 'Q)
(CDR ORACLE)))))
(NUMBERP NQ))
(EQUAL (NO F NQ ORACLE)
(LEN (SCAN F
(DET (LISTN (SUB1 NQ) 'Q)
(CDR ORACLE)))))).
This again simplifies, trivially, to the new goal:
(IMPLIES (AND (NOT (EQUAL NQ 0))
(NOT (CAR ORACLE))
(EQUAL (NO F (SUB1 NQ) (CDR ORACLE))
(LEN (SCAN F
(DET (LISTN (SUB1 NQ) 'Q)
(CDR ORACLE)))))
(NUMBERP NQ))
(EQUAL (NO F NQ ORACLE)
(NO F (SUB1 NQ) (CDR ORACLE)))),
which again simplifies, unfolding the functions B-XOR and NO, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
NO-IS-LEN-SCAN-DET-LISTN
(PROVE-LEMMA SCAN-FLG-APP-LISTN-NOT-FLG
(REWRITE)
(IMPLIES (AND (LESSP 0 N) (B-XOR FLG1 FLG2))
(EQUAL (SCAN FLG1 (APP (LISTN N FLG2) REST))
(APP (LISTN N FLG2) REST)))
((ENABLE SCAN LISTN)))
This simplifies, expanding the definitions of EQUAL and LESSP, to:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(B-XOR FLG1 FLG2))
(EQUAL (SCAN FLG1 (APP (LISTN N FLG2) REST))
(APP (LISTN N FLG2) REST))).
Name the above subgoal *1.
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 (ZEROP N)
(p FLG1 N FLG2 REST))
(IMPLIES (AND (NOT (ZEROP N))
(p FLG1 (SUB1 N) FLG2 REST))
(p FLG1 N FLG2 REST))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to establish that the measure (COUNT N) 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 N)
(NOT (EQUAL N 0))
(NUMBERP N)
(B-XOR FLG1 FLG2))
(EQUAL (SCAN FLG1 (APP (LISTN N FLG2) REST))
(APP (LISTN N FLG2) REST))),
which simplifies, expanding ZEROP, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (SUB1 N) 0)
(NOT (EQUAL N 0))
(NUMBERP N)
(B-XOR FLG1 FLG2))
(EQUAL (SCAN FLG1 (APP (LISTN N FLG2) REST))
(APP (LISTN N FLG2) REST))),
which simplifies, applying CDR-CONS, CAR-CONS, LISTP-LISTN, and
B-XOR-COMMUTES, and opening up the functions ZEROP, LISTN, APP, EQUAL, and
SCAN, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (SCAN FLG1
(APP (LISTN (SUB1 N) FLG2) REST))
(APP (LISTN (SUB1 N) FLG2) REST))
(NOT (EQUAL N 0))
(NUMBERP N)
(B-XOR FLG1 FLG2))
(EQUAL (SCAN FLG1 (APP (LISTN N FLG2) REST))
(APP (LISTN N FLG2) REST))).
This simplifies, applying CDR-CONS, CAR-CONS, and B-XOR-COMMUTES, and
expanding the functions ZEROP, LISTN, APP, and SCAN, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
SCAN-FLG-APP-LISTN-NOT-FLG
(DEFN SCAN-ORACLE
(FLG NQ ORACLE)
(IF (ZEROP NQ)
ORACLE
(IF (B-XOR FLG (CAR ORACLE))
ORACLE
(SCAN-ORACLE FLG
(SUB1 NQ)
(CDR ORACLE)))))
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP
inform us that the measure (COUNT NQ) decreases according to the well-founded
relation LESSP in each recursive call. Hence, SCAN-ORACLE is accepted under
the definitional principle.
[ 0.0 0.0 0.0 ]
SCAN-ORACLE
(PROVE-LEMMA SCAN-APP-DET-LISTN
(REWRITE)
(IMPLIES (AND (LESSP 0 N) (B-XOR FLG1 FLG2))
(EQUAL (SCAN FLG1
(APP (DET (LISTN NQ 'Q) ORACLE)
(APP (LISTN N FLG2) REST)))
(APP (DET (LISTN (NO FLG1 NQ ORACLE) 'Q)
(SCAN-ORACLE FLG1 NQ ORACLE))
(APP (LISTN N FLG2) REST))))
((INDUCT (DET-LISTN-HINT NQ ORACLE))
(ENABLE LISTN DET SCAN B-XOR)))
This conjecture can be simplified, using the abbreviations ZEROP, IMPLIES, NOT,
OR, and AND, to two new goals:
Case 2. (IMPLIES (AND (ZEROP NQ)
(LESSP 0 N)
(B-XOR FLG1 FLG2))
(EQUAL (SCAN FLG1
(APP (DET (LISTN NQ 'Q) ORACLE)
(APP (LISTN N FLG2) REST)))
(APP (DET (LISTN (NO FLG1 NQ ORACLE) 'Q)
(SCAN-ORACLE FLG1 NQ ORACLE))
(APP (LISTN N FLG2) REST)))),
which simplifies, using linear arithmetic, applying B-XOR-COMMUTES and
SCAN-FLG-APP-LISTN-NOT-FLG, and unfolding the definitions of ZEROP, EQUAL,
LESSP, B-XOR, LISTN, LISTP, DET, APP, NO, and SCAN-ORACLE, to the following
two new conjectures:
Case 2.2.
(IMPLIES (AND (EQUAL NQ 0)
(NOT (EQUAL N 0))
(NUMBERP N)
FLG1
(NOT FLG2))
(EQUAL (SCAN FLG1
(APP NIL (APP (LISTN N F) REST)))
(APP NIL (APP (LISTN N F) REST)))).
However this again simplifies, using linear arithmetic, applying
B-XOR-COMMUTES and SCAN-FLG-APP-LISTN-NOT-FLG, and opening up LISTP, APP,
and B-XOR, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP NQ))
(NOT (EQUAL N 0))
(NUMBERP N)
FLG1
(NOT FLG2))
(EQUAL (SCAN FLG1
(APP NIL (APP (LISTN N F) REST)))
(APP NIL (APP (LISTN N F) REST)))).
This again simplifies, using linear arithmetic, applying B-XOR-COMMUTES
and SCAN-FLG-APP-LISTN-NOT-FLG, and expanding the functions LISTP, APP,
and B-XOR, to:
T.
Case 1. (IMPLIES
(AND (NOT (EQUAL NQ 0))
(NUMBERP NQ)
(IMPLIES (AND (LESSP 0 N) (B-XOR FLG1 FLG2))
(EQUAL (SCAN FLG1
(APP (DET (LISTN (SUB1 NQ) 'Q)
(CDR ORACLE))
(APP (LISTN N FLG2) REST)))
(APP (DET (LISTN (NO FLG1 (SUB1 NQ) (CDR ORACLE))
'Q)
(SCAN-ORACLE FLG1
(SUB1 NQ)
(CDR ORACLE)))
(APP (LISTN N FLG2) REST))))
(LESSP 0 N)
(B-XOR FLG1 FLG2))
(EQUAL (SCAN FLG1
(APP (DET (LISTN NQ 'Q) ORACLE)
(APP (LISTN N FLG2) REST)))
(APP (DET (LISTN (NO FLG1 NQ ORACLE) 'Q)
(SCAN-ORACLE FLG1 NQ ORACLE))
(APP (LISTN N FLG2) REST)))).
This simplifies, applying B-XOR-COMMUTES, CDR-CONS, and CAR-CONS, and
unfolding the functions EQUAL, LESSP, AND, IMPLIES, B-XOR, LISTN, DET, NO,
and SCAN-ORACLE, to four new formulas:
Case 1.4.
(IMPLIES
(AND (NOT (EQUAL NQ 0))
(NUMBERP NQ)
(EQUAL (SCAN FLG1
(APP (DET (LISTN (SUB1 NQ) 'Q)
(CDR ORACLE))
(APP (LISTN N FLG2) REST)))
(APP (DET (LISTN (NO FLG1 (SUB1 NQ) (CDR ORACLE))
'Q)
(SCAN-ORACLE FLG1
(SUB1 NQ)
(CDR ORACLE)))
(APP (LISTN N FLG2) REST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT FLG1)
FLG2
(NOT (CAR ORACLE)))
(EQUAL (SCAN F
(APP (CONS F
(DET (LISTN (SUB1 NQ) 'Q)
(CDR ORACLE)))
(APP (LISTN N FLG2) REST)))
(APP (DET (LISTN (NO F NQ ORACLE) 'Q)
(SCAN-ORACLE F NQ ORACLE))
(APP (LISTN N FLG2) REST)))),
which again simplifies, rewriting with CDR-CONS and CAR-CONS, and
expanding the functions APP, B-XOR, and SCAN, to the new goal:
(IMPLIES (AND (NOT (EQUAL NQ 0))
(NUMBERP NQ)
(EQUAL (SCAN F
(APP (DET (LISTN (SUB1 NQ) 'Q)
(CDR ORACLE))
(APP (LISTN N FLG2) REST)))
(APP (DET (LISTN (NO F (SUB1 NQ) (CDR ORACLE))
'Q)
(SCAN-ORACLE F
(SUB1 NQ)
(CDR ORACLE)))
(APP (LISTN N FLG2) REST)))
(NOT (EQUAL N 0))
(NUMBERP N)
FLG2
(NOT (CAR ORACLE)))
(EQUAL (SCAN F
(APP (DET (LISTN (SUB1 NQ) 'Q)
(CDR ORACLE))
(APP (LISTN N FLG2) REST)))
(APP (DET (LISTN (NO F NQ ORACLE) 'Q)
(SCAN-ORACLE F NQ ORACLE))
(APP (LISTN N FLG2) REST)))),
which again simplifies, unfolding the functions B-XOR, NO, and SCAN-ORACLE,
to:
T.
Case 1.3.
(IMPLIES
(AND (NOT (EQUAL NQ 0))
(NUMBERP NQ)
(EQUAL (SCAN FLG1
(APP (DET (LISTN (SUB1 NQ) 'Q)
(CDR ORACLE))
(APP (LISTN N FLG2) REST)))
(APP (DET (LISTN (NO FLG1 (SUB1 NQ) (CDR ORACLE))
'Q)
(SCAN-ORACLE FLG1
(SUB1 NQ)
(CDR ORACLE)))
(APP (LISTN N FLG2) REST)))
(NOT (EQUAL N 0))
(NUMBERP N)
(NOT FLG1)
FLG2
(CAR ORACLE))
(EQUAL (SCAN F
(APP (CONS T
(DET (LISTN (SUB1 NQ) 'Q)
(CDR ORACLE)))
(APP (LISTN N FLG2) REST)))
(APP (DET (LISTN (NO F NQ ORACLE) 'Q)
(SCAN-ORACLE F NQ ORACLE))
(APP (LISTN N FLG2) REST)))),
which again simplifies, appealing to the lemmas CDR-CONS, CAR-CONS, and
B-XOR-COMMUTES, and expanding the functions APP, B-XOR, SCAN, NO, LISTN,
SCAN-ORACLE, EQUAL, and DET, to:
T.
Case 1.2.
(IMPLIES
(AND (NOT (EQUAL NQ 0))
(NUMBERP NQ)
(EQUAL (SCAN FLG1
(APP (DET (LISTN (SUB1 NQ) 'Q)
(CDR ORACLE))
(APP (LISTN N FLG2) REST)))
(APP (DET (LISTN (NO FLG1 (SUB1 NQ) (CDR ORACLE))
'Q)
(SCAN-ORACLE FLG1
(SUB1 NQ)
(CDR ORACLE)))
(APP (LISTN N FLG2) REST)))
(NOT (EQUAL N 0))
(NUMBERP N)
FLG1
(NOT FLG2)
(NOT (CAR ORACLE)))
(EQUAL (SCAN FLG1
(APP (CONS F
(DET (LISTN (SUB1 NQ) 'Q)
(CDR ORACLE)))
(APP (LISTN N F) REST)))
(APP (DET (LISTN NQ 'Q) ORACLE)
(APP (LISTN N F) REST)))),
which again simplifies, rewriting with CDR-CONS, CAR-CONS, and
B-XOR-COMMUTES, and opening up the functions APP, B-XOR, SCAN, LISTN,
EQUAL, and DET, to:
T.
Case 1.1.
(IMPLIES
(AND (NOT (EQUAL NQ 0))
(NUMBERP NQ)
(EQUAL (SCAN FLG1
(APP (DET (LISTN (SUB1 NQ) 'Q)
(CDR ORACLE))
(APP (LISTN N FLG2) REST)))
(APP (DET (LISTN (NO FLG1 (SUB1 NQ) (CDR ORACLE))
'Q)
(SCAN-ORACLE FLG1
(SUB1 NQ)
(CDR ORACLE)))
(APP (LISTN N FLG2) REST)))
(NOT (EQUAL N 0))
(NUMBERP N)
FLG1
(NOT FLG2)
(CAR ORACLE))
(EQUAL (SCAN FLG1
(APP (CONS T
(DET (LISTN (SUB1 NQ) 'Q)
(CDR ORACLE)))
(APP (LISTN N F) REST)))
(APP (DET (LISTN (NO FLG1 (SUB1 NQ) (CDR ORACLE))
'Q)
(SCAN-ORACLE FLG1
(SUB1 NQ)
(CDR ORACLE)))
(APP (LISTN N F) REST)))).
However this again simplifies, applying CDR-CONS and CAR-CONS, and
unfolding the definitions of APP, B-XOR, and SCAN, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
SCAN-APP-DET-LISTN
(DISABLE SCAN-FLG-APP-LISTN-NOT-FLG)
[ 0.0 0.0 0.0 ]
SCAN-FLG-APP-LISTN-NOT-FLG-OFF
(PROVE-LEMMA CDRN-APP
(REWRITE)
(EQUAL (CDRN N (APP A B))
(IF (LESSP N (LEN A))
(APP (CDRN N A) B)
(CDRN (DIFFERENCE N (LEN A)) B))))
This simplifies, clearly, to the following two new conjectures:
Case 2. (IMPLIES (NOT (LESSP N (LEN A)))
(EQUAL (CDRN N (APP A B))
(CDRN (DIFFERENCE N (LEN A)) B))).
Appealing to the lemma DIFFERENCE-ELIM, we now replace N by (PLUS (LEN A) X)
to eliminate (DIFFERENCE N (LEN A)). We use the type restriction lemma
noted when DIFFERENCE was introduced to constrain the new variable. We must
thus prove two new goals:
Case 2.2.
(IMPLIES (AND (NOT (NUMBERP N))
(NOT (LESSP N (LEN A))))
(EQUAL (CDRN N (APP A B))
(CDRN (DIFFERENCE N (LEN A)) B))),
which further simplifies, using linear arithmetic, applying EQUAL-LEN-0
and DIFFERENCE-IS-0, and opening up the definitions of LESSP, APP, CDRN,
LEN, and EQUAL, to:
T.
Case 2.1.
(IMPLIES (AND (NUMBERP X)
(NOT (LESSP (PLUS (LEN A) X) (LEN A))))
(EQUAL (CDRN (PLUS (LEN A) X) (APP A B))
(CDRN X B))).
But this further simplifies, applying PLUS-COMMUTES1, to the new
conjecture:
(IMPLIES (AND (NUMBERP X)
(NOT (LESSP (PLUS X (LEN A)) (LEN A))))
(EQUAL (CDRN (PLUS X (LEN A)) (APP A B))
(CDRN X B))),
which we would normally push and work on later by induction. But if we
must use induction to prove the input conjecture, we prefer to induct on
the original formulation of the problem. Thus we will disregard all that
we have previously done, give the name *1 to the original input, and work
on it.
So now let us return to:
(EQUAL (CDRN N (APP A B))
(IF (LESSP N (LEN A))
(APP (CDRN N A) B)
(CDRN (DIFFERENCE N (LEN A)) B))).
We named this *1. We will try to prove it by induction. There are seven
plausible inductions. However, they merge into one likely candidate induction.
We will induct according to the following scheme:
(AND (IMPLIES (ZEROP N) (p N A B))
(IMPLIES (AND (NOT (ZEROP N))
(p (SUB1 N) (CDR A) B))
(p N A B))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP inform
us that the measure (COUNT N) 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 produces two new formulas:
Case 2. (IMPLIES (ZEROP N)
(EQUAL (CDRN N (APP A B))
(IF (LESSP N (LEN A))
(APP (CDRN N A) B)
(CDRN (DIFFERENCE N (LEN A)) B)))),
which simplifies, using linear arithmetic, rewriting with DIFFERENCE-IS-0,
and unfolding ZEROP, APP, EQUAL, CDRN, LEN, and LESSP, to the following two
new goals:
Case 2.2.
(IMPLIES (AND (EQUAL N 0)
(LISTP A)
(EQUAL (ADD1 (LEN (CDR A))) 0))
(EQUAL (CONS (CAR A) (APP (CDR A) B))
B)).
This again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (NOT (NUMBERP N))
(LISTP A)
(EQUAL (ADD1 (LEN (CDR A))) 0))
(EQUAL (CONS (CAR A) (APP (CDR A) B))
B)),
which again simplifies, using linear arithmetic, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP N))
(EQUAL (CDRN (SUB1 N) (APP (CDR A) B))
(IF (LESSP (SUB1 N) (LEN (CDR A)))
(APP (CDRN (SUB1 N) (CDR A)) B)
(CDRN (DIFFERENCE (SUB1 N) (LEN (CDR A)))
B))))
(EQUAL (CDRN N (APP A B))
(IF (LESSP N (LEN A))
(APP (CDRN N A) B)
(CDRN (DIFFERENCE N (LEN A)) B)))),
which simplifies, opening up the functions ZEROP, APP, LEN, and CDRN, to
eight new conjectures:
Case 1.8.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LEN (CDR A))))
(EQUAL (CDRN (SUB1 N) (APP (CDR A) B))
(CDRN (DIFFERENCE (SUB1 N) (LEN (CDR A)))
B))
(LISTP A)
(NOT (LESSP N (ADD1 (LEN (CDR A))))))
(EQUAL (CDRN N
(CONS (CAR A) (APP (CDR A) B)))
(CDRN (DIFFERENCE N (ADD1 (LEN (CDR A))))
B))),
which again simplifies, rewriting with the lemmas SUB1-ADD1 and CDR-CONS,
and opening up the functions LESSP, CDRN, and DIFFERENCE, to:
T.
Case 1.7.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LEN (CDR A))))
(EQUAL (CDRN (SUB1 N) (APP (CDR A) B))
(CDRN (DIFFERENCE (SUB1 N) (LEN (CDR A)))
B))
(LISTP A)
(LESSP N (ADD1 (LEN (CDR A)))))
(EQUAL (CDRN N
(CONS (CAR A) (APP (CDR A) B)))
(APP (CDRN (SUB1 N) (CDR A)) B))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.6.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LEN (CDR A))))
(EQUAL (CDRN (SUB1 N) (APP (CDR A) B))
(CDRN (DIFFERENCE (SUB1 N) (LEN (CDR A)))
B))
(NOT (LISTP A))
(NOT (LESSP N 0)))
(EQUAL (CDRN N B)
(CDRN (DIFFERENCE N 0) B))),
which again simplifies, expanding the definitions of EQUAL, LESSP, and
DIFFERENCE, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (LESSP (SUB1 N) (LEN (CDR A))))
(EQUAL (CDRN (SUB1 N) (APP (CDR A) B))
(CDRN (DIFFERENCE (SUB1 N) (LEN (CDR A)))
B))
(NOT (LISTP A))
(LESSP N 0))
(EQUAL (CDRN N B)
(APP (CDRN (SUB1 N) (CDR A)) B))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (SUB1 N) (LEN (CDR A)))
(EQUAL (CDRN (SUB1 N) (APP (CDR A) B))
(APP (CDRN (SUB1 N) (CDR A)) B))
(LISTP A)
(NOT (LESSP N (ADD1 (LEN (CDR A))))))
(EQUAL (CDRN N
(CONS (CAR A) (APP (CDR A) B)))
(CDRN (DIFFERENCE N (ADD1 (LEN (CDR A))))
B))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (SUB1 N) (LEN (CDR A)))
(EQUAL (CDRN (SUB1 N) (APP (CDR A) B))
(APP (CDRN (SUB1 N) (CDR A)) B))
(LISTP A)
(LESSP N (ADD1 (LEN (CDR A)))))
(EQUAL (CDRN N
(CONS (CAR A) (APP (CDR A) B)))
(APP (CDRN (SUB1 N) (CDR A)) B))),
which again simplifies, applying SUB1-ADD1 and CDR-CONS, and expanding the
definitions of LESSP and CDRN, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (SUB1 N) (LEN (CDR A)))
(EQUAL (CDRN (SUB1 N) (APP (CDR A) B))
(APP (CDRN (SUB1 N) (CDR A)) B))
(NOT (LISTP A))
(NOT (LESSP N 0)))
(EQUAL (CDRN N B)
(CDRN (DIFFERENCE N 0) B))).
This again simplifies, expanding the functions EQUAL, LESSP, and
DIFFERENCE, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(LESSP (SUB1 N) (LEN (CDR A)))
(EQUAL (CDRN (SUB1 N) (APP (CDR A) B))
(APP (CDRN (SUB1 N) (CDR A)) B))
(NOT (LISTP A))
(LESSP N 0))
(EQUAL (CDRN N B)
(APP (CDRN (SUB1 N) (CDR A)) B))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
CDRN-APP
(PROVE-LEMMA NOT-LESSP-NO
(REWRITE)
(NOT (LESSP N (NO FLG N ORACLE))))
WARNING: Note that the proposed lemma NOT-LESSP-NO is to be stored as zero
type prescription rules, zero compound recognizer rules, one linear rule, and
zero replacement rules.
Give the conjecture the name *1.
We will appeal to induction. Two inductions are suggested by terms in
the conjecture. However, they merge into one likely candidate induction. We
will induct according to the following scheme:
(AND (IMPLIES (OR (EQUAL (NO FLG N ORACLE) 0)
(NOT (NUMBERP (NO FLG N ORACLE))))
(p N FLG ORACLE))
(IMPLIES (AND (NOT (OR (EQUAL (NO FLG N ORACLE) 0)
(NOT (NUMBERP (NO FLG N ORACLE)))))
(OR (EQUAL N 0) (NOT (NUMBERP N))))
(p N FLG ORACLE))
(IMPLIES (AND (NOT (OR (EQUAL (NO FLG N ORACLE) 0)
(NOT (NUMBERP (NO FLG N ORACLE)))))
(NOT (OR (EQUAL N 0) (NOT (NUMBERP N))))
(p (SUB1 N) FLG (CDR ORACLE)))
(p N FLG ORACLE))).
Linear arithmetic, the lemmas SUB1-LESSEQP and SUB1-LESSP, and the definitions
of OR and NOT inform us that the measure (COUNT N) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for ORACLE. The above induction scheme
produces the following three new conjectures:
Case 3. (IMPLIES (OR (EQUAL (NO FLG N ORACLE) 0)
(NOT (NUMBERP (NO FLG N ORACLE))))
(NOT (LESSP N (NO FLG N ORACLE)))).
This simplifies, expanding the functions NO, NOT, OR, EQUAL, and LESSP, to:
T.
Case 2. (IMPLIES (AND (NOT (OR (EQUAL (NO FLG N ORACLE) 0)
(NOT (NUMBERP (NO FLG N ORACLE)))))
(OR (EQUAL N 0) (NOT (NUMBERP N))))
(NOT (LESSP N (NO FLG N ORACLE)))).
This simplifies, opening up NO, NOT, and OR, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (EQUAL (NO FLG N ORACLE) 0)
(NOT (NUMBERP (NO FLG N ORACLE)))))
(NOT (OR (EQUAL N 0) (NOT (NUMBERP N))))
(NOT (LESSP (SUB1 N)
(NO FLG (SUB1 N) (CDR ORACLE)))))
(NOT (LESSP N (NO FLG N ORACLE)))).
This simplifies, rewriting with B-XOR-COMMUTES, and expanding NO, NOT, OR,
and LESSP, to three new formulas:
Case 1.3.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (NO FLG (SUB1 N) (CDR ORACLE))
0))
(NOT (LESSP (SUB1 N)
(NO FLG (SUB1 N) (CDR ORACLE))))
(NOT (B-XOR FLG (CAR ORACLE))))
(NOT (LESSP N
(NO FLG (SUB1 N) (CDR ORACLE))))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (NO FLG (SUB1 N) (CDR ORACLE))
0))
(NOT (LESSP (SUB1 N)
(NO FLG (SUB1 N) (CDR ORACLE))))
(B-XOR FLG (CAR ORACLE)))
(NOT (LESSP N N))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(B-XOR FLG (CAR ORACLE))
(NOT (LESSP (SUB1 N)
(NO FLG (SUB1 N) (CDR ORACLE)))))
(NOT (LESSP (SUB1 N) (SUB1 N)))),
which again simplifies, using linear arithmetic, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
NOT-LESSP-NO
(PROVE-LEMMA BOOLP-IMPLIES-DET-LISTN
(REWRITE)
(IMPLIES (BOOLP FLG)
(EQUAL (DET (LISTN N FLG) ORACLE)
(LISTN N FLG)))
((ENABLE BOOLP)))
This formula simplifies, appealing to the lemma DET-LISTN, and expanding the
function BOOLP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
BOOLP-IMPLIES-DET-LISTN
(PROVE-LEMMA LEN-WARP NIL
(EQUAL (LEN (WARP LST TS TR W R))
(N* (LEN LST) TS TR W R))
((ENABLE WARP)))
Name the conjecture *1.
Perhaps we can prove it by induction. Two inductions are suggested by
terms in the conjecture, 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 (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W))
(p LST TS TR W R))
(IMPLIES (AND (NOT (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W)))
(p (LST+ LST TS (PLUS TR R) W)
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R))
(p LST TS TR W R))).
Linear arithmetic, the lemmas CAR-CONS, CDR-CONS, TS+-INCREASES-TR, SUB1-ADD1,
ADD1-EQUAL, CONS-EQUAL, PLUS-COMMUTES1, and LST+-WEAKLY-SHORTENS-LST, and the
definitions of LISTP, ORDINALP, LESSP, ORD-LESSP, EQUAL, OR, and ZEROP inform
us that the measure:
(CONS (CONS (ADD1 (COUNT LST)) 0)
(DIFFERENCE (PLUS TS W) TR))
decreases according to the well-founded relation ORD-LESSP in each induction
step of the scheme. The above induction scheme leads to the following two new
conjectures:
Case 2. (IMPLIES (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W))
(EQUAL (LEN (WARP LST TS TR W R))
(N* (LEN LST) TS TR W R))).
This simplifies, rewriting with the lemmas PLUS-COMMUTES1 and LEN-ENDP, and
opening up the definitions of ZEROP, OR, EQUAL, WARP, LEN, and N*, to:
T.
Case 1. (IMPLIES (AND (NOT (OR (ZEROP R)
(ENDP LST TS (PLUS TR R) W)))
(EQUAL (LEN (WARP (LST+ LST TS (PLUS TR R) W)
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R))
(N* (LEN (LST+ LST TS (PLUS TR R) W))
(TS+ LST TS (PLUS TR R) W)
(PLUS TR R)
W R)))
(EQUAL (LEN (WARP LST TS TR W R))
(N* (LEN LST) TS TR W R))).
This simplifies, appealing to the lemmas PLUS-COMMUTES1, LEN-ENDP, LEN-LST+,
LEN-TS+, and CDR-CONS, and expanding ZEROP, OR, WARP, LEN, and N*, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LEN-WARP
(PROVE-LEMMA N*-PLUS-LEMMA
(REWRITE)
(EQUAL (LEN (WARP (LISTN (DIFFERENCE J DWG) F)
TS TR W R))
(N* (DIFFERENCE J DWG) TS TR W R))
((USE (LEN-WARP (LST (LISTN (DIFFERENCE J DWG) F))))))
This conjecture simplifies, applying the lemma LEN-LISTN, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
N*-PLUS-LEMMA
(PROVE-LEMMA N*-PLUS
(REWRITE)
(IMPLIES (AND (NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP 2 J)
(NUMBERP I)
(NUMBERP J))
(EQUAL (PLUS (N* I TS TR W R)
(NQG (NLST* I TS TR W R)
(NTS* I TS TR W R)
(NTR* I TS TR W R)
W R)
(N* (DIFFERENCE J
(DWG (NLST* I TS TR W R)
(NTS* I TS TR W R)
(NTR* I TS TR W R)
W R))
(TSG (NLST* I TS TR W R)
(NTS* I TS TR W R)
(NTR* I TS TR W R)
W R)
(TRG (NLST* I TS TR W R)
(NTS* I TS TR W R)
(NTR* I TS TR W R)
W R)
W R))
(N* (ADD1 (PLUS I J)) TS TR W R)))
((USE (LEN-WARP (LST (APP (LISTN I T)
(CONS 'Q (LISTN J F))))))))
WARNING: the previously added lemma, PLUS-COMMUTES2, could be applied
whenever the newly proposed N*-PLUS could!
WARNING: the previously added lemma, PLUS-COMMUTES1, could be applied
whenever the newly proposed N*-PLUS could!
This formula can be simplified, using the abbreviations ZEROP, NOT, AND,
IMPLIES, and LEN-APP, to:
(IMPLIES (AND (EQUAL (LEN (WARP (APP (LISTN I T)
(CONS 'Q (LISTN J F)))
TS TR W R))
(N* (PLUS (LEN (LISTN I T))
(LEN (CONS 'Q (LISTN J F))))
TS TR W R))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(LESSP W (TIMES 2 R))
(LESSP R (TIMES 2 W))
(LESSP 2 J)
(NUMBERP I)
(NUMBERP J))
(EQUAL (PLUS (N* I TS TR W R)
(NQG (NLST* I TS TR W R)
(NTS* I TS TR W R)
(NTR* I TS TR W R)
W R)
(N* (DIFFERENCE J
(DWG (NLST* I TS TR W R)
(NTS* I TS TR W R)
(NTR* I TS TR W R)
W R))
(TSG (NLST* I TS TR W R)
(NTS* I TS TR W R)
(NTR* I TS TR W R)
W R)
(TRG (NLST* I TS TR W R)
(NTS* I TS TR W R)
(NTR* I TS TR W R)
W R)
W R))
(N* (ADD1 (PLUS I J)) TS TR W R))),
which simplifies, using linear arithmetic, applying the lemmas LEN-LISTN,
DWG-BOUNDS, CDRN-LISTN, WARP-APP-LISTN-Q, N*-PLUS-LEMMA, LEN-APP, CDR-CONS,
and PLUS-ADD1, and expanding the definitions of NQ, DW, TS, TR, and LEN, to:
T.
Q.E.D.
[ 0.0 0.9 0.0 ]
N*-PLUS
(DISABLE N*-PLUS-LEMMA)
[ 0.0 0.0 0.0 ]
N*-PLUS-LEMMA-OFF
(PROVE-LEMMA LOOP-KILLER-2B
(REWRITE)
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(B-XOR FLG1 FLG2))
(EQUAL (CDRN 10
(SCAN FLG1
(APP (DET (LISTN NQ 'Q) ORACLE1)
(APP (DET (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2)
REST))))
(APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
(CSIG FLG1 (CAR MSG)))
REST)))
((ENABLE CSIG) (DO-NOT-INDUCT T)))
This conjecture can be simplified, using the abbreviations RATE-PROXIMITY,
ZEROP, NOT, AND, and IMPLIES, to the conjecture:
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(B-XOR FLG1 FLG2))
(EQUAL (CDRN 10
(SCAN FLG1
(APP (DET (LISTN NQ 'Q) ORACLE1)
(APP (DET (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2)
REST))))
(APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
(CSIG FLG1 (CAR MSG)))
REST))).
This simplifies, appealing to the lemmas ADD1-PLUS-12-DIFFERENCE-4-DW,
PLUS-COMMUTES1, and WARP-SMOOTH-CELL, and expanding the functions SUB1,
NUMBERP, EQUAL, TIMES, LESSP, RATE-PROXIMITY, PLUS, and CSIG, to the following
two new formulas:
Case 2. (IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(B-XOR FLG1 FLG2)
(NOT (CAR MSG)))
(EQUAL
(CDRN 10
(SCAN FLG1
(APP (DET (LISTN NQ 'Q) ORACLE1)
(APP (DET (LISTN (N* (DIFFERENCE 17 DW) TS TR W R)
(B-NOT FLG1))
ORACLE2)
REST))))
(APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
(B-NOT FLG1))
REST))).
But this again simplifies, using linear arithmetic, rewriting with the
lemmas DET-LISTN, B-XOR-COMMUTES, B-XOR-B-NOT, N*-LOWER-BOUND,
SCAN-APP-DET-LISTN, LEN-LISTN, LEN-DET, PLUS-COMMUTES1,
DIFFERENCE-DIFFERENCE, CDRN-LISTN, DIFFERENCE-IS-0,
DIFFERENCE-DIFFERENCE-OTHER, and CDRN-APP, and expanding the functions BOOLP,
RATE-PROXIMITY, SUB1, NUMBERP, EQUAL, TIMES, and CDRN, to three new
conjectures:
Case 2.3.
(IMPLIES
(AND (LISTP MSG)
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(B-XOR FLG1 FLG2)
(NOT (CAR MSG))
(LESSP 17 DW))
(EQUAL
(CDRN 10
(SCAN FLG1
(APP (DET (LISTN NQ 'Q) ORACLE1)
(APP (DET (LISTN (N* (DIFFERENCE 17 DW) TS TR W R)
(B-NOT FLG1))
ORACLE2)
REST))))
(APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
(B-NOT FLG1))
REST))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.2.
(IMPLIES
(AND (LISTP MSG)
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(B-XOR FLG1 FLG2)
(NOT (CAR MSG))
(NOT (LESSP 17 DW))
(NOT (LESSP 10 (NO FLG1 NQ ORACLE1)))
(NOT (LESSP (DIFFERENCE 10 (NO FLG1 NQ ORACLE1))
(N* (DIFFERENCE 17 DW) TS TR W R))))
(EQUAL REST
(APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
(B-NOT FLG1))
REST))),
which again simplifies, using linear arithmetic, rewriting with the lemma
N*-LOWER-BOUND, and expanding the definitions of TIMES, EQUAL, NUMBERP,
SUB1, and RATE-PROXIMITY, to:
T.
Case 2.1.
(IMPLIES
(AND (LISTP MSG)
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(B-XOR FLG1 FLG2)
(NOT (CAR MSG))
(NOT (LESSP 17 DW))
(LESSP 10 (NO FLG1 NQ ORACLE1)))
(EQUAL
(APP (CDRN 10
(DET (LISTN (NO FLG1 NQ ORACLE1) 'Q)
(SCAN-ORACLE FLG1 NQ ORACLE1)))
(APP (LISTN (N* (DIFFERENCE 17 DW) TS TR W R)
(B-NOT FLG1))
REST))
(APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
(B-NOT FLG1))
REST))),
which again simplifies, using linear arithmetic and applying NOT-LESSP-NO,
to:
T.
Case 1. (IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(B-XOR FLG1 FLG2)
(CAR MSG))
(EQUAL
(CDRN 10
(SCAN FLG1
(APP
(DET (LISTN NQ 'Q) ORACLE1)
(APP
(DET
(APP
(LISTN (N* (DIFFERENCE 4 DW) TS TR W R)
(B-NOT FLG1))
(APP
(LISTN (NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
'Q)
(LISTN
(N* (DIFFERENCE 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))
(TSG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
W R)
FLG1)))
ORACLE2)
REST))))
(APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
FLG1)
REST))).
However this again simplifies, using linear arithmetic, rewriting with
DET-LISTN, ORACLE*-LISTN, BOOLP-IMPLIES-DET-LISTN, DET-APP, APP-ASSOC,
B-XOR-COMMUTES, B-XOR-B-NOT, N*-LOWER-BOUND, SCAN-APP-DET-LISTN, LEN-LISTN,
LEN-DET, DIFFERENCE-DIFFERENCE-OTHER, PLUS-ASSOCIATES, NQG-BOUNDS,
LESSP-TRG*-PLUS-W-TSG*, PLUS-COMMUTES1, NOT-LESSP-TRG*-TSG*, DWG-BOUNDS,
N*-UPPER-BOUND, NOT-LESSP-NO, ADD1-PLUS-12-DIFFERENCE-4-DW, N*-PLUS,
PLUS-COMMUTES2, DIFFERENCE-DIFFERENCE, CDRN-LISTN, DIFFERENCE-IS-0, and
CDRN-APP, and expanding the definitions of RATE-PROXIMITY, SUB1, NUMBERP,
EQUAL, TIMES, PLUS, LESSP, and CDRN, to the following eight new formulas:
Case 1.8.
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(B-XOR FLG1 FLG2)
(CAR MSG)
(LESSP 4 DW))
(EQUAL
(CDRN 10
(SCAN FLG1
(APP
(DET (LISTN NQ 'Q) ORACLE1)
(APP
(DET
(APP
(LISTN (N* (DIFFERENCE 4 DW) TS TR W R)
(B-NOT FLG1))
(APP
(LISTN (NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
'Q)
(LISTN
(N* (DIFFERENCE 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))
(TSG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
W R)
FLG1)))
ORACLE2)
REST))))
(APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
FLG1)
REST))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.7.
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(B-XOR FLG1 FLG2)
(CAR MSG)
(LESSP 10
(PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 4 DW) TS TR W R)
(NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))))
(EQUAL
(CDRN 10
(SCAN FLG1
(APP
(DET (LISTN NQ 'Q) ORACLE1)
(APP
(DET
(APP
(LISTN (N* (DIFFERENCE 4 DW) TS TR W R)
(B-NOT FLG1))
(APP
(LISTN (NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
'Q)
(LISTN
(N* (DIFFERENCE 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))
(TSG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
W R)
FLG1)))
ORACLE2)
REST))))
(APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
FLG1)
REST))),
which again simplifies, using linear arithmetic, applying the lemmas
NOT-LESSP-NO, N*-UPPER-BOUND, and NQG-BOUNDS, and unfolding the functions
TIMES, EQUAL, NUMBERP, SUB1, and RATE-PROXIMITY, to:
(IMPLIES
(AND (LESSP 4 DW)
(LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(B-XOR FLG1 FLG2)
(CAR MSG)
(LESSP 10
(PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 4 DW) TS TR W R)
(NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))))
(EQUAL
(CDRN 10
(SCAN FLG1
(APP
(DET (LISTN NQ 'Q) ORACLE1)
(APP
(DET
(APP
(LISTN (N* (DIFFERENCE 4 DW) TS TR W R)
(B-NOT FLG1))
(APP
(LISTN (NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
'Q)
(LISTN
(N* (DIFFERENCE 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))
(TSG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
W R)
FLG1)))
ORACLE2)
REST))))
(APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
FLG1)
REST))).
However this again simplifies, using linear arithmetic, to:
T.
Case 1.6.
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(B-XOR FLG1 FLG2)
(CAR MSG)
(LESSP 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)))
(EQUAL
(CDRN 10
(SCAN FLG1
(APP
(DET (LISTN NQ 'Q) ORACLE1)
(APP
(DET
(APP
(LISTN (N* (DIFFERENCE 4 DW) TS TR W R)
(B-NOT FLG1))
(APP
(LISTN (NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
'Q)
(LISTN
(N* (DIFFERENCE 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))
(TSG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
W R)
FLG1)))
ORACLE2)
REST))))
(APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
FLG1)
REST))),
which again simplifies, using linear arithmetic and applying the lemma
DWG-BOUNDS, to:
T.
Case 1.5.
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(B-XOR FLG1 FLG2)
(CAR MSG)
(LESSP 17 DW))
(EQUAL
(CDRN 10
(SCAN FLG1
(APP
(DET (LISTN NQ 'Q) ORACLE1)
(APP
(DET
(APP
(LISTN (N* (DIFFERENCE 4 DW) TS TR W R)
(B-NOT FLG1))
(APP
(LISTN (NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
'Q)
(LISTN
(N* (DIFFERENCE 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))
(TSG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
W R)
FLG1)))
ORACLE2)
REST))))
(APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
FLG1)
REST))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.4.
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(B-XOR FLG1 FLG2)
(CAR MSG)
(NOT (LESSP 17 DW))
(NOT (LESSP 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)))
(NOT (LESSP 10
(PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 4 DW) TS TR W R)
(NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))))
(NOT (LESSP 4 DW))
(NOT (LESSP 10 (NO FLG1 NQ ORACLE1)))
(LESSP (DIFFERENCE 10 (NO FLG1 NQ ORACLE1))
(N* (DIFFERENCE 4 DW) TS TR W R)))
(EQUAL
(APP
(CDRN (DIFFERENCE 10 (NO FLG1 NQ ORACLE1))
(LISTN (N* (DIFFERENCE 4 DW) TS TR W R)
(B-NOT FLG1)))
(APP
(DET (LISTN (NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
'Q)
ORACLE2)
(APP
(LISTN (N* (DIFFERENCE 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))
(TSG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
W R)
FLG1)
REST)))
(APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
FLG1)
REST))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.3.
(IMPLIES
(AND
(LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(B-XOR FLG1 FLG2)
(CAR MSG)
(NOT (LESSP 17 DW))
(NOT (LESSP 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)))
(NOT (LESSP 10
(PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 4 DW) TS TR W R)
(NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))))
(NOT (LESSP 4 DW))
(NOT (LESSP 10 (NO FLG1 NQ ORACLE1)))
(NOT (LESSP (DIFFERENCE 10 (NO FLG1 NQ ORACLE1))
(N* (DIFFERENCE 4 DW) TS TR W R)))
(NOT (LESSP (DIFFERENCE 10
(PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 4 DW) TS TR W R)))
(NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)))
(NOT
(LESSP (DIFFERENCE 10
(PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 4 DW) TS TR W R)
(NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)))
(N* (DIFFERENCE 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))
(TSG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
W R))))
(EQUAL REST
(APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
FLG1)
REST))),
which again simplifies, using linear arithmetic, applying
NOT-LESSP-TRG*-TSG*, PLUS-COMMUTES1, LESSP-TRG*-PLUS-W-TSG*, NQG-BOUNDS,
DWG-BOUNDS, and N*-LOWER-BOUND, and expanding the functions PLUS, TIMES,
EQUAL, NUMBERP, SUB1, and RATE-PROXIMITY, to:
T.
Case 1.2.
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(B-XOR FLG1 FLG2)
(CAR MSG)
(NOT (LESSP 17 DW))
(NOT (LESSP 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)))
(NOT (LESSP 10
(PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 4 DW) TS TR W R)
(NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))))
(NOT (LESSP 4 DW))
(NOT (LESSP 10 (NO FLG1 NQ ORACLE1)))
(NOT (LESSP (DIFFERENCE 10 (NO FLG1 NQ ORACLE1))
(N* (DIFFERENCE 4 DW) TS TR W R)))
(LESSP (DIFFERENCE 10
(PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 4 DW) TS TR W R)))
(NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)))
(EQUAL
(APP
(CDRN (DIFFERENCE 10
(PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 4 DW) TS TR W R)))
(DET (LISTN (NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
'Q)
ORACLE2))
(APP
(LISTN (N* (DIFFERENCE 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))
(TSG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
W R)
FLG1)
REST))
(APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
FLG1)
REST))).
But this again simplifies, using linear arithmetic, to:
T.
Case 1.1.
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(B-XOR FLG1 FLG2)
(CAR MSG)
(NOT (LESSP 17 DW))
(NOT (LESSP 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)))
(NOT (LESSP 10
(PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 4 DW) TS TR W R)
(NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))))
(NOT (LESSP 4 DW))
(LESSP 10 (NO FLG1 NQ ORACLE1)))
(EQUAL
(APP
(CDRN 10
(DET (LISTN (NO FLG1 NQ ORACLE1) 'Q)
(SCAN-ORACLE FLG1 NQ ORACLE1)))
(APP
(LISTN (N* (DIFFERENCE 4 DW) TS TR W R)
(B-NOT FLG1))
(APP
(DET (LISTN (NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
'Q)
ORACLE2)
(APP
(LISTN (N* (DIFFERENCE 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))
(TSG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
W R)
FLG1)
REST))))
(APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
FLG1)
REST))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 2.6 0.0 ]
LOOP-KILLER-2B
(DISABLE N*-PLUS)
[ 0.0 0.0 0.0 ]
N*-PLUS-OFF
(DISABLE CDRN-APP)
[ 0.0 0.0 0.0 ]
CDRN-APP-OFF
(DISABLE SCAN-APP-DET-LISTN)
[ 0.0 0.0 0.0 ]
SCAN-APP-DET-LISTN-OFF
(DISABLE BOOLP-IMPLIES-DET-LISTN)
[ 0.0 0.0 0.0 ]
BOOLP-IMPLIES-DET-LISTN-OFF
(DISABLE WARP-SMOOTH-CELL)
[ 0.0 0.0 0.0 ]
WARP-SMOOTH-CELL-OFF
(PROVE-LEMMA CAR-DET-LISTN
(REWRITE)
(EQUAL (CAR (DET (LISTN N 'Q) ORACLE))
(IF (ZEROP N)
0
(IF (CAR ORACLE) T F)))
((INDUCT (DET-LISTN-HINT N ORACLE))
(ENABLE LISTN DET)))
This formula can be simplified, using the abbreviations ZEROP, NOT, OR, and
AND, to the following two new goals:
Case 2. (IMPLIES (ZEROP N)
(EQUAL (CAR (DET (LISTN N 'Q) ORACLE))
(COND ((ZEROP N) 0)
((CAR ORACLE) T)
(T F)))).
This simplifies, opening up ZEROP, EQUAL, LISTN, LISTP, DET, and CAR, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (CAR (DET (LISTN (SUB1 N) 'Q)
(CDR ORACLE)))
(COND ((ZEROP (SUB1 N)) 0)
((CADR ORACLE) T)
(T F))))
(EQUAL (CAR (DET (LISTN N 'Q) ORACLE))
(COND ((ZEROP N) 0)
((CAR ORACLE) T)
(T F)))).
This simplifies, rewriting with CDR-CONS and CAR-CONS, and opening up the
definitions of ZEROP, LISTN, EQUAL, DET, CONS, CDR, CAR, and LISTP, to six
new formulas:
Case 1.6.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (SUB1 N) 0))
(CADR ORACLE)
(EQUAL (CAR (DET (LISTN (SUB1 N) 'Q)
(CDR ORACLE)))
T)
(NOT (CAR ORACLE)))
(EQUAL (CAR (CONS F
(DET (LISTN (SUB1 N) 'Q)
(CDR ORACLE))))
F)),
which again simplifies, appealing to the lemma CAR-CONS, and unfolding
EQUAL, to:
T.
Case 1.5.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (SUB1 N) 0))
(CADR ORACLE)
(EQUAL (CAR (DET (LISTN (SUB1 N) 'Q)
(CDR ORACLE)))
T)
(CAR ORACLE))
(EQUAL (CAR (CONS T
(DET (LISTN (SUB1 N) 'Q)
(CDR ORACLE))))
T)),
which again simplifies, applying CAR-CONS, and opening up the definition
of EQUAL, to:
T.
Case 1.4.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (SUB1 N) 0))
(NOT (CADR ORACLE))
(EQUAL (CAR (DET (LISTN (SUB1 N) 'Q)
(CDR ORACLE)))
F)
(NOT (CAR ORACLE)))
(EQUAL (CAR (CONS F
(DET (LISTN (SUB1 N) 'Q)
(CDR ORACLE))))
F)).
However this again simplifies, rewriting with CAR-CONS, and unfolding the
function EQUAL, to:
T.
Case 1.3.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT (EQUAL (SUB1 N) 0))
(NOT (CADR ORACLE))
(EQUAL (CAR (DET (LISTN (SUB1 N) 'Q)
(CDR ORACLE)))
F)
(CAR ORACLE))
(EQUAL (CAR (CONS T
(DET (LISTN (SUB1 N) 'Q)
(CDR ORACLE))))
T)).
But this again simplifies, applying CAR-CONS, and expanding the definition
of EQUAL, to:
T.
Case 1.2.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (SUB1 N) 0)
(EQUAL (CAR (DET (LISTN (SUB1 N) 'Q)
(CDR ORACLE)))
0)
(NOT (CAR ORACLE)))
(EQUAL (CAR (LIST F)) F)).
This again simplifies, expanding the functions EQUAL, LISTN, LISTP, DET,
and CAR, to:
T.
Case 1.1.
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(EQUAL (SUB1 N) 0)
(EQUAL (CAR (DET (LISTN (SUB1 N) 'Q)
(CDR ORACLE)))
0)
(CAR ORACLE))
(EQUAL (CAR (LIST T)) T)),
which again simplifies, opening up EQUAL, LISTN, LISTP, DET, and CAR, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CAR-DET-LISTN
(PROVE-LEMMA LISTP-DET
(REWRITE)
(EQUAL (LISTP (DET LST ORACLE))
(LISTP LST))
((ENABLE DET)))
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 LST) (p LST ORACLE))
(IMPLIES (AND (NOT (NLISTP LST))
(EQUAL (CAR LST) 'Q)
(p (CDR LST) (CDR ORACLE)))
(p LST ORACLE))
(IMPLIES (AND (NOT (NLISTP LST))
(NOT (EQUAL (CAR LST) 'Q))
(p (CDR LST) ORACLE))
(p LST ORACLE))).
Linear arithmetic, the lemmas CDR-LESSEQP and CDR-LESSP, and the definition of
NLISTP can be used to establish that the measure (COUNT LST) decreases
according to the well-founded relation LESSP in each induction step of the
scheme. Note, however, the inductive instances chosen for ORACLE. The above
induction scheme generates the following three new formulas:
Case 3. (IMPLIES (NLISTP LST)
(EQUAL (LISTP (DET LST ORACLE))
(LISTP LST))).
This simplifies, expanding the definitions of NLISTP, DET, and EQUAL, to:
T.
Case 2. (IMPLIES (AND (NOT (NLISTP LST))
(EQUAL (CAR LST) 'Q)
(EQUAL (LISTP (DET (CDR LST) (CDR ORACLE)))
(LISTP (CDR LST))))
(EQUAL (LISTP (DET LST ORACLE))
(LISTP LST))).
This simplifies, opening up the function NLISTP, to:
T.
Case 1. (IMPLIES (AND (NOT (NLISTP LST))
(NOT (EQUAL (CAR LST) 'Q))
(EQUAL (LISTP (DET (CDR LST) ORACLE))
(LISTP (CDR LST))))
(EQUAL (LISTP (DET LST ORACLE))
(LISTP LST))).
This simplifies, opening up the definition of NLISTP, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
LISTP-DET
(PROVE-LEMMA CAR-SCAN-ORACLE
(REWRITE)
(IMPLIES (NOT (ZEROP (NO FLG NQ ORACLE)))
(IFF (CAR (SCAN-ORACLE FLG NQ ORACLE))
(B-NOT FLG)))
((ENABLE LISTN LISTP-LISTN DET B-XOR B-NOT)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, and
IMPLIES, to:
(IMPLIES (AND (NOT (EQUAL (NO FLG NQ ORACLE) 0))
(NUMBERP (NO FLG NQ ORACLE)))
(IFF (CAR (SCAN-ORACLE FLG NQ ORACLE))
(B-NOT FLG))).
This simplifies, expanding the functions B-NOT and IFF, to the following two
new formulas:
Case 2. (IMPLIES (AND (NOT (EQUAL (NO FLG NQ ORACLE) 0))
(NOT (CAR (SCAN-ORACLE FLG NQ ORACLE))))
FLG).
This again simplifies, obviously, to the new formula:
(IMPLIES (NOT (EQUAL (NO F NQ ORACLE) 0))
(CAR (SCAN-ORACLE F NQ ORACLE))),
which we will name *1.
Case 1. (IMPLIES (AND (NOT (EQUAL (NO FLG NQ ORACLE) 0))
(CAR (SCAN-ORACLE FLG NQ ORACLE)))
(NOT FLG)),
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 (NOT (ZEROP (NO FLG NQ ORACLE)))
(IFF (CAR (SCAN-ORACLE FLG NQ ORACLE))
(B-NOT FLG))).
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 NQ) (p FLG NQ ORACLE))
(IMPLIES (AND (NOT (ZEROP NQ))
(B-XOR FLG (CAR ORACLE)))
(p FLG NQ ORACLE))
(IMPLIES (AND (NOT (ZEROP NQ))
(NOT (B-XOR FLG (CAR ORACLE)))
(p FLG (SUB1 NQ) (CDR ORACLE)))
(p FLG NQ ORACLE))).
Linear arithmetic, the lemma COUNT-NUMBERP, and the definition of ZEROP can be
used to establish that the measure (COUNT NQ) decreases according to the
well-founded relation LESSP in each induction step of the scheme. Note,
however, the inductive instance chosen for ORACLE. The above induction scheme
generates four new conjectures:
Case 4. (IMPLIES (AND (ZEROP NQ)
(NOT (ZEROP (NO FLG NQ ORACLE))))
(IFF (CAR (SCAN-ORACLE FLG NQ ORACLE))
(B-NOT FLG))),
which simplifies, opening up ZEROP, EQUAL, and NO, to:
T.
Case 3. (IMPLIES (AND (NOT (ZEROP NQ))
(B-XOR FLG (CAR ORACLE))
(NOT (ZEROP (NO FLG NQ ORACLE))))
(IFF (CAR (SCAN-ORACLE FLG NQ ORACLE))
(B-NOT FLG))),
which simplifies, applying B-XOR-COMMUTES, and opening up the definitions of
ZEROP, B-XOR, NO, SCAN-ORACLE, B-NOT, and IFF, to:
T.
Case 2. (IMPLIES (AND (NOT (ZEROP NQ))
(NOT (B-XOR FLG (CAR ORACLE)))
(ZEROP (NO FLG (SUB1 NQ) (CDR ORACLE)))
(NOT (ZEROP (NO FLG NQ ORACLE))))
(IFF (CAR (SCAN-ORACLE FLG NQ ORACLE))
(B-NOT FLG))).
This simplifies, expanding ZEROP, B-XOR, B-NOT, IFF, and NO, to:
(IMPLIES (AND (NOT (EQUAL NQ 0))
(NUMBERP NQ)
(NOT FLG)
(NOT (CAR ORACLE))
(EQUAL (NO FLG (SUB1 NQ) (CDR ORACLE))
0)
(NOT (EQUAL (NO F NQ ORACLE) 0)))
(CAR (SCAN-ORACLE F NQ ORACLE))),
which again simplifies, unfolding B-XOR, NO, and EQUAL, to:
T.
Case 1. (IMPLIES (AND (NOT (ZEROP NQ))
(NOT (B-XOR FLG (CAR ORACLE)))
(IFF (CAR (SCAN-ORACLE FLG
(SUB1 NQ)
(CDR ORACLE)))
(B-NOT FLG))
(NOT (ZEROP (NO FLG NQ ORACLE))))
(IFF (CAR (SCAN-ORACLE FLG NQ ORACLE))
(B-NOT FLG))),
which simplifies, unfolding ZEROP, B-XOR, B-NOT, IFF, NO, and SCAN-ORACLE,
to:
(IMPLIES (AND (NOT (EQUAL NQ 0))
(NUMBERP NQ)
(NOT FLG)
(NOT (CAR ORACLE))
(CAR (SCAN-ORACLE FLG
(SUB1 NQ)
(CDR ORACLE)))
(NOT (EQUAL (NO F NQ ORACLE) 0)))
(CAR (SCAN-ORACLE F NQ ORACLE))).
This again simplifies, obviously, to:
(IMPLIES (AND (NOT (EQUAL NQ 0))
(NUMBERP NQ)
(NOT (CAR ORACLE))
(CAR (SCAN-ORACLE F
(SUB1 NQ)
(CDR ORACLE)))
(NOT (EQUAL (NO F NQ ORACLE) 0)))
(CAR (SCAN-ORACLE F NQ ORACLE))),
which again simplifies, expanding B-XOR and SCAN-ORACLE, to:
T.
That finishes the proof of *1. Q.E.D.
[ 0.0 0.0 0.0 ]
CAR-SCAN-ORACLE
(PROVE-LEMMA LOOP-KILLER-2A-LEMMA
(REWRITE)
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL (CAR (SCAN FLG1
(APP (DET (LISTN NQ 'Q) ORACLE1)
(APP (DET (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE)
REST))))
(B-NOT FLG1)))
((ENABLE WARP-SMOOTH-CELL SCAN-APP-DET-LISTN CDRN-APP CAR-APP CAR-LISTN
BOOLP-IMPLIES-DET-LISTN)
(DO-NOT-INDUCT T)))
This conjecture can be simplified, using the abbreviations RATE-PROXIMITY,
ZEROP, NOT, AND, and IMPLIES, to:
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL (CAR (SCAN FLG1
(APP (DET (LISTN NQ 'Q) ORACLE1)
(APP (DET (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE)
REST))))
(B-NOT FLG1))).
This simplifies, applying ADD1-PLUS-12-DIFFERENCE-4-DW, PLUS-COMMUTES1, and
WARP-SMOOTH-CELL, and expanding the definitions of SUB1, NUMBERP, EQUAL, TIMES,
LESSP, RATE-PROXIMITY, and PLUS, to two new conjectures:
Case 2. (IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2)
(NOT (CAR MSG)))
(EQUAL
(CAR (SCAN FLG1
(APP (DET (LISTN NQ 'Q) ORACLE1)
(APP (DET (LISTN (N* (DIFFERENCE 17 DW) TS TR W R)
(B-NOT FLG1))
ORACLE)
REST))))
(B-NOT FLG1))),
which again simplifies, using linear arithmetic, applying the lemmas
DET-LISTN, B-XOR-COMMUTES, B-XOR-B-NOT, N*-LOWER-BOUND, SCAN-APP-DET-LISTN,
LISTP-LISTN, LISTP-DET, CAR-LISTN, CAR-APP, CAR-SCAN-ORACLE, and
CAR-DET-LISTN, and expanding BOOLP, RATE-PROXIMITY, SUB1, NUMBERP, EQUAL,
and TIMES, to two new conjectures:
Case 2.2.
(IMPLIES
(AND (LISTP MSG)
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2)
(NOT (CAR MSG))
(LESSP 17 DW))
(EQUAL
(CAR (SCAN FLG1
(APP (DET (LISTN NQ 'Q) ORACLE1)
(APP (DET (LISTN (N* (DIFFERENCE 17 DW) TS TR W R)
(B-NOT FLG1))
ORACLE)
REST))))
(B-NOT FLG1))),
which again simplifies, using linear arithmetic, to:
T.
Case 2.1.
(IMPLIES (AND (LISTP MSG)
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2)
(NOT (CAR MSG))
(NOT (LESSP 17 DW))
(EQUAL (NO FLG1 NQ ORACLE1) 0)
(EQUAL (N* (DIFFERENCE 17 DW) TS TR W R)
0))
(EQUAL (CAR REST) (B-NOT FLG1))),
which again simplifies, using linear arithmetic, applying N*-LOWER-BOUND,
and unfolding the definitions of TIMES, EQUAL, NUMBERP, SUB1, and
RATE-PROXIMITY, to:
T.
Case 1. (IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2)
(CAR MSG))
(EQUAL
(CAR
(SCAN FLG1
(APP
(DET (LISTN NQ 'Q) ORACLE1)
(APP
(DET
(APP
(LISTN (N* (DIFFERENCE 4 DW) TS TR W R)
(B-NOT FLG1))
(APP
(LISTN (NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
'Q)
(LISTN
(N* (DIFFERENCE 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))
(TSG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
W R)
FLG1)))
ORACLE)
REST))))
(B-NOT FLG1))).
But this again simplifies, using linear arithmetic, appealing to the lemmas
DET-LISTN, ORACLE*-LISTN, BOOLP-IMPLIES-DET-LISTN, DET-APP, APP-ASSOC,
B-XOR-COMMUTES, B-XOR-B-NOT, N*-LOWER-BOUND, SCAN-APP-DET-LISTN, LISTP-LISTN,
LISTP-DET, CAR-LISTN, CAR-APP, CAR-DET-LISTN, and CAR-SCAN-ORACLE, and
expanding RATE-PROXIMITY, SUB1, NUMBERP, EQUAL, and TIMES, to five new
formulas:
Case 1.5.
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2)
(CAR MSG)
(LESSP 4 DW))
(EQUAL
(CAR
(SCAN FLG1
(APP
(DET (LISTN NQ 'Q) ORACLE1)
(APP
(DET
(APP
(LISTN (N* (DIFFERENCE 4 DW) TS TR W R)
(B-NOT FLG1))
(APP
(LISTN (NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
'Q)
(LISTN
(N* (DIFFERENCE 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))
(TSG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
W R)
FLG1)))
ORACLE)
REST))))
(B-NOT FLG1))),
which again simplifies, using linear arithmetic, to:
T.
Case 1.4.
(IMPLIES (AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2)
(CAR MSG)
(NOT (LESSP 4 DW))
(EQUAL (NO FLG1 NQ ORACLE1) 0)
(EQUAL (N* (DIFFERENCE 4 DW) TS TR W R)
0)
(NOT (EQUAL (NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
0))
(CAR ORACLE))
(EQUAL T (B-NOT FLG1))),
which again simplifies, using linear arithmetic, rewriting with
N*-LOWER-BOUND, and expanding the functions TIMES, EQUAL, NUMBERP, SUB1,
and RATE-PROXIMITY, to:
T.
Case 1.3.
(IMPLIES (AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2)
(CAR MSG)
(NOT (LESSP 4 DW))
(EQUAL (NO FLG1 NQ ORACLE1) 0)
(EQUAL (N* (DIFFERENCE 4 DW) TS TR W R)
0)
(NOT (EQUAL (NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
0))
(NOT (CAR ORACLE)))
(EQUAL F (B-NOT FLG1))).
But this again simplifies, using linear arithmetic, rewriting with
N*-LOWER-BOUND, and opening up TIMES, EQUAL, NUMBERP, SUB1, and
RATE-PROXIMITY, to:
T.
Case 1.2.
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2)
(CAR MSG)
(NOT (LESSP 4 DW))
(EQUAL (NO FLG1 NQ ORACLE1) 0)
(EQUAL (N* (DIFFERENCE 4 DW) TS TR W R)
0)
(EQUAL (NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
0)
(EQUAL (N* (DIFFERENCE 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))
(TSG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
W R)
0))
(EQUAL (CAR REST) (B-NOT FLG1))).
But this again simplifies, using linear arithmetic, applying
N*-LOWER-BOUND, and expanding the functions TIMES, EQUAL, NUMBERP, SUB1,
and RATE-PROXIMITY, to:
T.
Case 1.1.
(IMPLIES
(AND
(LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2)
(CAR MSG)
(NOT (LESSP 4 DW))
(EQUAL (NO FLG1 NQ ORACLE1) 0)
(EQUAL (N* (DIFFERENCE 4 DW) TS TR W R)
0)
(EQUAL (NQG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
0)
(NOT
(EQUAL (N* (DIFFERENCE 12
(DWG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R))
(TSG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 4 DW) TS TR W R)
(NTS* (DIFFERENCE 4 DW) TS TR W R)
(NTR* (DIFFERENCE 4 DW) TS TR W R)
W R)
W R)
0)))
(EQUAL FLG1 (B-NOT FLG1))).
But this again simplifies, using linear arithmetic, applying
N*-LOWER-BOUND, and opening up the functions TIMES, EQUAL, NUMBERP, SUB1,
and RATE-PROXIMITY, to:
T.
Q.E.D.
[ 0.0 0.6 0.0 ]
LOOP-KILLER-2A-LEMMA
(DISABLE CAR-DET-LISTN)
[ 0.0 0.0 0.0 ]
CAR-DET-LISTN-OFF
(PROVE-LEMMA EQUAL-DIFFERENCE-0
(REWRITE)
(EQUAL (EQUAL (DIFFERENCE X Y) 0)
(NOT (LESSP Y X))))
This conjecture simplifies, unfolding NOT, to two new conjectures:
Case 2. (IMPLIES (NOT (EQUAL (DIFFERENCE X Y) 0))
(LESSP Y X)),
which again simplifies, rewriting with the lemma DIFFERENCE-IS-0, and
opening up the definition of EQUAL, to:
T.
Case 1. (IMPLIES (EQUAL (DIFFERENCE X Y) 0)
(NOT (LESSP Y X))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
EQUAL-DIFFERENCE-0
(PROVE-LEMMA LOOP-KILLER-2A
(REWRITE)
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL (RECV-BIT 10
(SCAN FLG1
(APP (DET (LISTN NQ 'Q) ORACLE1)
(APP (DET (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE)
REST))))
(CAR MSG)))
((ENABLE RECV-BIT CAR-APP CAR-LISTN CSIG)
(DO-NOT-INDUCT T)))
This formula can be simplified, using the abbreviations RATE-PROXIMITY, ZEROP,
NOT, AND, and IMPLIES, to the new formula:
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL
(RECV-BIT 10
(SCAN FLG1
(APP (DET (LISTN NQ 'Q) ORACLE1)
(APP (DET (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE)
REST))))
(CAR MSG))),
which simplifies, applying LOOP-KILLER-2B, EQUAL-DIFFERENCE-0, LISTP-LISTN,
CAR-LISTN, CAR-APP, and LOOP-KILLER-2A-LEMMA, and unfolding the functions SUB1,
NUMBERP, EQUAL, TIMES, NTH, CSIG, RATE-PROXIMITY, and RECV-BIT, to the
following three new goals:
Case 3. (IMPLIES (AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2)
(NOT (LESSP 10
(PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R)))))
(EQUAL (B-XOR (B-NOT FLG1) (CAR REST))
(CAR MSG))).
However this again simplifies, using linear arithmetic, applying the lemma
N*-LOWER-BOUND, and expanding the functions TIMES, EQUAL, NUMBERP, SUB1, and
RATE-PROXIMITY, to:
(IMPLIES (AND (LESSP 17 DW)
(LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2)
(NOT (LESSP 10
(PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R)))))
(EQUAL (B-XOR (B-NOT FLG1) (CAR REST))
(CAR MSG))).
However this again simplifies, using linear arithmetic, to:
T.
Case 2. (IMPLIES (AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2)
(LESSP 10
(PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R)))
(CAR MSG))
(EQUAL (B-XOR (B-NOT FLG1) FLG1)
(CAR MSG))),
which again simplifies, rewriting with B-XOR-COMMUTES, B-XOR-B-NOT, and
BOOLP-T, to:
T.
Case 1. (IMPLIES (AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2)
(LESSP 10
(PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R)))
(NOT (CAR MSG)))
(EQUAL (B-XOR (B-NOT FLG1) (B-NOT FLG1))
(CAR MSG))).
But this again simplifies, applying the lemmas B-XOR-COMMUTES, B-XOR-B-NOT,
and NOT-B-XOR-B-NOT, and expanding the functions BOOLP and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
LOOP-KILLER-2A
(DISABLE LOOP-KILLER-2A-LEMMA)
[ 0.0 0.0 0.0 ]
LOOP-KILLER-2A-LEMMA-OFF
(PROVE-LEMMA LOOP-KILLER-2C
(REWRITE)
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW)))
(EQUAL (CAR (APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
(CSIG FLG1 (CAR MSG)))
REST))
(CSIG FLG1 (CAR MSG))))
((ENABLE CAR-APP CAR-LISTN)
(DO-NOT-INDUCT T)))
This conjecture can be simplified, using the abbreviations RATE-PROXIMITY,
ZEROP, NOT, AND, and IMPLIES, to the conjecture:
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW)))
(EQUAL
(CAR (APP (LISTN (DIFFERENCE (PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R))
10)
(CSIG FLG1 (CAR MSG)))
REST))
(CSIG FLG1 (CAR MSG)))).
This simplifies, applying the lemmas EQUAL-DIFFERENCE-0, LISTP-LISTN,
CAR-LISTN, and CAR-APP, and expanding the functions SUB1, NUMBERP, EQUAL, and
TIMES, to:
(IMPLIES (AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(NOT (LESSP 10
(PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R)))))
(EQUAL (CAR REST)
(CSIG FLG1 (CAR MSG)))),
which again simplifies, using linear arithmetic, rewriting with N*-LOWER-BOUND,
and unfolding the functions TIMES, EQUAL, NUMBERP, SUB1, and RATE-PROXIMITY,
to:
(IMPLIES (AND (LESSP 17 DW)
(LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(NOT (LESSP 10
(PLUS (NO FLG1 NQ ORACLE1)
(N* (DIFFERENCE 17 DW) TS TR W R)))))
(EQUAL (CAR REST)
(CSIG FLG1 (CAR MSG)))),
which again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
LOOP-KILLER-2C
(PROVE-LEMMA RECV-APP-LISTN
(REWRITE)
(EQUAL (RECV N FLG K
(APP (LISTN M FLG) REST))
(RECV N FLG K REST))
((EXPAND (RECV N FLG K
(APP (LISTN M FLG) REST))
(RECV N FLG K REST))))
WARNING: the newly proposed lemma, RECV-APP-LISTN, could be applied whenever
the previously added lemma TOP-RECV-STEP could.
This conjecture simplifies, applying SCAN-APP-LISTN, and expanding the
functions RECV and NTH, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
RECV-APP-LISTN
(PROVE-LEMMA LOOP-KILLER-2
(REWRITE)
(IMPLIES (AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL (RECV (LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(APP (DET (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE)
REST)))
(CONS (CAR MSG)
(RECV (LEN (CDR MSG))
(CSIG FLG1 (CAR MSG))
10 REST))))
((EXPAND (RECV (LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(APP (DET (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE)
REST))))))
This formula can be simplified, using the abbreviations RATE-PROXIMITY, ZEROP,
NOT, AND, and IMPLIES, to the new formula:
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL (RECV (LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(APP (DET (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE)
REST)))
(CONS (CAR MSG)
(RECV (LEN (CDR MSG))
(CSIG FLG1 (CAR MSG))
10 REST)))),
which simplifies, applying the lemmas LOOP-KILLER-2B, LOOP-KILLER-2C,
SUB1-ADD1, LOOP-KILLER-2A, and RECV-APP-LISTN, and expanding the functions
SUB1, NUMBERP, EQUAL, TIMES, LEN, NTH, RATE-PROXIMITY, and RECV, to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
LOOP-KILLER-2
(DISABLE RECV-APP-LISTN)
[ 0.0 0.0 0.0 ]
RECV-APP-LISTN-OFF
(PROVE-LEMMA CDR-APP-CELL-REST
(REWRITE)
(IMPLIES (NOT (ZEROP M))
(EQUAL (CDR (APP (CELL FLG1 M N BIT) REST))
(APP (CELL FLG1 (SUB1 M) N BIT)
REST)))
((ENABLE CDR-APP CELL LISTN)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, and
IMPLIES, to the formula:
(IMPLIES (AND (NOT (EQUAL M 0)) (NUMBERP M))
(EQUAL (CDR (APP (CELL FLG1 M N BIT) REST))
(APP (CELL FLG1 (SUB1 M) N BIT)
REST))).
This simplifies, rewriting with APP-ASSOC, LISTP-LISTN, and CDR-APP, and
expanding the function CELL, to:
(IMPLIES (AND (NOT (EQUAL M 0)) (NUMBERP M))
(EQUAL (APP (CDR (LISTN M (B-NOT FLG1)))
(APP (LISTN N (CSIG FLG1 BIT)) REST))
(APP (LISTN (SUB1 M) (B-NOT FLG1))
(APP (LISTN N (CSIG FLG1 BIT))
REST)))).
But this again simplifies, rewriting with CDR-CONS, and opening up the
function LISTN, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
CDR-APP-CELL-REST
(PROVE-LEMMA SMOOTH-APP-CELL-REST
(REWRITE)
(IMPLIES (AND (NOT (ZEROP N))
(B-XOR FLG2 FLG1))
(EQUAL (SMOOTH FLG2
(APP (CELL FLG1 M N BIT) REST))
(APP (SMOOTH FLG2 (CELL FLG1 M N BIT))
(SMOOTH (CSIG FLG1 BIT) REST))))
((ENABLE CELL SMOOTH-FLG-APP-LISTN-FLG
SMOOTH-FLG-APP-LISTN-NOT-FLG SMOOTH-FLG-LISTN-FLG
SMOOTH-FLG-LISTN-NOT-FLG CSIG B-NOT B-XOR)))
This conjecture can be simplified, using the abbreviations ZEROP, NOT, AND,
and IMPLIES, to the goal:
(IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(B-XOR FLG2 FLG1))
(EQUAL (SMOOTH FLG2
(APP (CELL FLG1 M N BIT) REST))
(APP (SMOOTH FLG2 (CELL FLG1 M N BIT))
(SMOOTH (CSIG FLG1 BIT) REST)))).
This simplifies, rewriting with APP-ASSOC, SMOOTH-FLG-APP-LISTN-FLG, and
APP-CANCELLATION, and unfolding the functions B-XOR, CSIG, B-NOT, and CELL, to
four new goals:
Case 4. (IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT FLG2)
FLG1
(NOT BIT))
(EQUAL (SMOOTH F (APP (LISTN N F) REST))
(APP (SMOOTH F (LISTN N F))
(SMOOTH F REST)))),
which again simplifies, applying SMOOTH-FLG-APP-LISTN-FLG and
SMOOTH-FLG-LISTN-FLG, and expanding the definition of B-XOR, to:
T.
Case 3. (IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
(NOT FLG2)
FLG1 BIT)
(EQUAL (SMOOTH F (APP (LISTN N FLG1) REST))
(APP (SMOOTH F (LISTN N FLG1))
(SMOOTH FLG1 REST)))).
This again simplifies, applying B-XOR-COMMUTES, SMOOTH-FLG-LISTN-NOT-FLG,
CDR-CONS, CAR-CONS, and SMOOTH-FLG-APP-LISTN-NOT-FLG, and expanding the
definitions of B-XOR and APP, to:
T.
Case 2. (IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
FLG2
(NOT FLG1)
(NOT BIT))
(EQUAL (SMOOTH FLG2 (APP (LISTN N T) REST))
(APP (SMOOTH FLG2 (LISTN N T))
(SMOOTH T REST)))).
This again simplifies, appealing to the lemmas SMOOTH-FLG-APP-LISTN-FLG,
SMOOTH-FLG-LISTN-FLG, SMOOTH-CONGRUENCE, and APP-CANCELLATION, and opening
up the definition of B-XOR, to:
T.
Case 1. (IMPLIES (AND (NOT (EQUAL N 0))
(NUMBERP N)
FLG2
(NOT FLG1)
BIT)
(EQUAL (SMOOTH FLG2 (APP (LISTN N F) REST))
(APP (SMOOTH FLG2 (LISTN N F))
(SMOOTH F REST)))),
which again simplifies, applying B-XOR-COMMUTES, SMOOTH-FLG-LISTN-NOT-FLG,
CDR-CONS, CAR-CONS, and SMOOTH-FLG-APP-LISTN-NOT-FLG, and expanding the
functions B-XOR and APP, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
SMOOTH-APP-CELL-REST
(PROVE-LEMMA LOOP-KILLER-0A NIL
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(EQUAL (CDR MSG) NIL)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL
(RECV (LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(DET (TARGET (WARP (CDRN DW
(SMOOTH FLG2
(APP (CDR (CELLS FLG1 5 13 MSG))
(LISTN P2 T))))
TS TR W R))
ORACLE2)))
MSG))
((EXPAND (CELLS FLG1 5 13 MSG))
(DISABLE LEN)
(ENABLE CDRN-DW-SMOOTH-CELL CDRN-DW-APP-SMOOTH-CELL WARP-APP)))
This conjecture can be simplified, using the abbreviations RATE-PROXIMITY, NOT,
AND, and IMPLIES, to:
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(EQUAL (CDR MSG) NIL)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL
(RECV
(LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(DET (TARGET (WARP (CDRN DW
(SMOOTH FLG2
(APP (CDR (CELLS FLG1 5 13 MSG))
(LISTN P2 T))))
TS TR W R))
ORACLE2)))
MSG)).
This simplifies, rewriting with CDR-APP-CELL-REST, APP-ASSOC, B-XOR-COMMUTES,
SMOOTH-APP-CELL-REST, CDRN-DW-SMOOTH-CELL, CDRN-DW-APP-SMOOTH-CELL,
ADD1-PLUS-12-DIFFERENCE-4-DW, PLUS-COMMUTES1, LEN-CELL, LEN-SMOOTH, LEN-TS*,
LEN-TR*, WARP-APP, DET-APP, LOOP-KILLER-2, CAR-CONS, and CDR-CONS, and opening
up the definitions of SUB1, NUMBERP, EQUAL, TIMES, CELLS, LISTP, APP, PLUS,
RATE-PROXIMITY, BVP, LEN, and RECV, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
LOOP-KILLER-0A
(PROVE-LEMMA LOOP-KILLER-0
(REWRITE)
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(EQUAL (CDR MSG) NIL)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL (RECV (LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(DET (WARP (CDRN DW
(SMOOTH FLG2
(APP (CDR (CELLS FLG1 5 13 MSG))
(LISTN P2 T))))
TS TR W R)
ORACLE2)))
MSG))
((ENABLE TARGET)
(USE (LOOP-KILLER-0A))))
This conjecture can be simplified, using the abbreviations RATE-PROXIMITY, NOT,
AND, IMPLIES, and TARGET, to the goal:
(IMPLIES
(AND
(IMPLIES
(AND (LISTP MSG)
(BOOLP (CAR MSG))
(EQUAL (CDR MSG) NIL)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL
(RECV (LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(DET (WARP (CDRN DW
(SMOOTH FLG2
(APP (CDR (CELLS FLG1 5 13 MSG))
(LISTN P2 T))))
TS TR W R)
ORACLE2)))
MSG))
(LISTP MSG)
(BOOLP (CAR MSG))
(EQUAL (CDR MSG) NIL)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL
(RECV (LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(DET (WARP (CDRN DW
(SMOOTH FLG2
(APP (CDR (CELLS FLG1 5 13 MSG))
(LISTN P2 T))))
TS TR W R)
ORACLE2)))
MSG)).
This simplifies, applying B-XOR-COMMUTES, and unfolding the functions EQUAL,
NOT, TIMES, NUMBERP, SUB1, RATE-PROXIMITY, AND, ADD1, LEN, and IMPLIES, to:
T.
Q.E.D.
[ 0.0 0.1 0.0 ]
LOOP-KILLER-0
(DISABLE CDR-APP-CELL-REST)
[ 0.0 0.0 0.0 ]
CDR-APP-CELL-REST-OFF
(PROVE-LEMMA BOOLP-B-NOT
(REWRITE)
(BOOLP (B-NOT X))
((ENABLE BOOLP B-NOT)))
This conjecture can be simplified, using the abbreviation BOOLP, to the goal:
(IMPLIES (NOT (EQUAL (B-NOT X) T))
(EQUAL (B-NOT X) F)).
This simplifies, trivially, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
BOOLP-B-NOT
(PROVE-LEMMA BOOLP-CSIG
(REWRITE)
(IMPLIES (BOOLP FLG)
(BOOLP (CSIG FLG BIT)))
((ENABLE BOOLP B-NOT)))
This conjecture can be simplified, using the abbreviations BOOLP and IMPLIES,
to:
(IMPLIES (AND (BOOLP FLG)
(NOT (EQUAL (CSIG FLG BIT) T)))
(EQUAL (CSIG FLG BIT) F)).
This simplifies, unfolding the definitions of BOOLP and EQUAL, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
BOOLP-CSIG
(PROVE-LEMMA LOOP
(REWRITE)
(IMPLIES
(AND (BVP MSG)
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL (RECV (LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(DET (WARP (CDRN DW
(SMOOTH FLG2
(APP (CDR (CELLS FLG1 5 13 MSG))
(LISTN P2 T))))
TS TR W R)
ORACLE2)))
MSG))
((DISABLE CELLS LEN)
(INDUCT (LOOP-IND-HINT NQ ORACLE1 DW FLG2 FLG1 MSG TS TR W R ORACLE2))))
This conjecture can be simplified, using the abbreviations RATE-PROXIMITY,
ZEROP, IMPLIES, NLISTP, NOT, OR, and AND, to three new goals:
Case 3. (IMPLIES
(AND (NOT (LISTP MSG))
(BVP MSG)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL
(RECV (LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(DET (WARP (CDRN DW
(SMOOTH FLG2
(APP (CDR (CELLS FLG1 5 13 MSG))
(LISTN P2 T))))
TS TR W R)
ORACLE2)))
MSG)),
which simplifies, opening up the functions BVP, SUB1, NUMBERP, EQUAL, TIMES,
LEN, and RECV, to:
T.
Case 2. (IMPLIES
(AND (LISTP MSG)
(NOT (LISTP (CDR MSG)))
(BVP MSG)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL
(RECV (LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(DET (WARP (CDRN DW
(SMOOTH FLG2
(APP (CDR (CELLS FLG1 5 13 MSG))
(LISTN P2 T))))
TS TR W R)
ORACLE2)))
MSG)),
which simplifies, rewriting with LOOP-KILLER-0, and expanding BVP, SUB1,
NUMBERP, EQUAL, TIMES, and RATE-PROXIMITY, to:
T.
Case 1. (IMPLIES
(AND
(LISTP MSG)
(LISTP (CDR MSG))
(IMPLIES
(AND (BVP (CDR MSG))
(NUMBERP (TSG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R))
(NUMBERP (TRG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R))
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP (TRG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(TSG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)))
(LESSP (TRG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(PLUS (TSG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
W))
(RATE-PROXIMITY W R)
(NUMBERP (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R))
(NOT (LESSP 3
(NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)))
(NUMBERP (DWG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R))
(NOT (LESSP 1
(DWG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)))
(BOOLP (CSIG FLG1 (CAR MSG)))
(BOOLP (B-NOT (CSIG FLG1 (CAR MSG))))
(B-XOR (CSIG FLG1 (CAR MSG))
(B-NOT (CSIG FLG1 (CAR MSG)))))
(EQUAL
(RECV
(LEN (CDR MSG))
(CSIG FLG1 (CAR MSG))
10
(APP
(DET (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))
(DET (WARP (CDRN (DWG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(SMOOTH (B-NOT (CSIG FLG1 (CAR MSG)))
(APP (CDR (CELLS (CSIG FLG1 (CAR MSG))
5 13
(CDR MSG)))
(LISTN P2 T))))
(TSG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
W R)
(ORACLE* (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2)))))
(CDR MSG)))
(BVP MSG)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL
(RECV (LEN MSG)
FLG1 10
(APP (DET (LISTN NQ 'Q) ORACLE1)
(DET (WARP (CDRN DW
(SMOOTH FLG2
(APP (CDR (CELLS FLG1 5 13 MSG))
(LISTN P2 T))))
TS TR W R)
ORACLE2)))
MSG)).
This simplifies, rewriting with PLUS-COMMUTES1, BOOLP-CSIG, BOOLP-B-NOT,
B-XOR-COMMUTES, B-XOR-B-NOT, LOOP-KILLER-2, LOOP-KILLER-1, CAR-CONS,
CDR-CONS, and CONS-CAR-CDR, and expanding ZEROP, NOT, TIMES, EQUAL, NUMBERP,
SUB1, RATE-PROXIMITY, AND, IMPLIES, and BVP, to four new conjectures:
Case 1.4.
(IMPLIES
(AND (LISTP MSG)
(LISTP (CDR MSG))
(LESSP (TRG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(TSG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R))
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL
(CONS
(CAR MSG)
(RECV
(LEN (CDR MSG))
(CSIG FLG1 (CAR MSG))
10
(APP
(DET (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))
(DET (WARP (CDRN (DWG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(SMOOTH (B-NOT (CSIG FLG1 (CAR MSG)))
(APP (CDR (CELLS (CSIG FLG1 (CAR MSG))
5 13
(CDR MSG)))
(LISTN P2 T))))
(TSG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
W R)
(ORACLE* (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))))))
MSG)),
which again simplifies, using linear arithmetic, applying
NOT-LESSP-TRG*-TSG* and PLUS-COMMUTES1, and opening up the functions SUB1,
NUMBERP, EQUAL, TIMES, and PLUS, to:
T.
Case 1.3.
(IMPLIES
(AND (LISTP MSG)
(LISTP (CDR MSG))
(NOT (LESSP (TRG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(PLUS W
(TSG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R))))
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL
(CONS
(CAR MSG)
(RECV
(LEN (CDR MSG))
(CSIG FLG1 (CAR MSG))
10
(APP
(DET (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))
(DET (WARP (CDRN (DWG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(SMOOTH (B-NOT (CSIG FLG1 (CAR MSG)))
(APP (CDR (CELLS (CSIG FLG1 (CAR MSG))
5 13
(CDR MSG)))
(LISTN P2 T))))
(TSG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
W R)
(ORACLE* (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))))))
MSG)).
This again simplifies, using linear arithmetic, rewriting with
LESSP-TRG*-PLUS-W-TSG* and PLUS-COMMUTES1, and opening up the functions
SUB1, NUMBERP, EQUAL, TIMES, and PLUS, to:
T.
Case 1.2.
(IMPLIES
(AND (LISTP MSG)
(LISTP (CDR MSG))
(LESSP 3
(NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R))
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL
(CONS
(CAR MSG)
(RECV
(LEN (CDR MSG))
(CSIG FLG1 (CAR MSG))
10
(APP
(DET (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))
(DET (WARP (CDRN (DWG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(SMOOTH (B-NOT (CSIG FLG1 (CAR MSG)))
(APP (CDR (CELLS (CSIG FLG1 (CAR MSG))
5 13
(CDR MSG)))
(LISTN P2 T))))
(TSG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
W R)
(ORACLE* (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))))))
MSG)).
This again simplifies, using linear arithmetic and applying the lemma
NQG-BOUNDS, to:
T.
Case 1.1.
(IMPLIES
(AND (LISTP MSG)
(LISTP (CDR MSG))
(LESSP 1
(DWG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R))
(BOOLP (CAR MSG))
(BVP (CDR MSG))
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (PLUS W (TIMES 17 W))
(TIMES 17 R)))
(NOT (LESSP (PLUS R R (TIMES 17 R))
(PLUS W (TIMES 17 W))))
(NUMBERP NQ)
(NOT (LESSP 3 NQ))
(NUMBERP DW)
(NOT (LESSP 1 DW))
(BOOLP FLG1)
(BOOLP FLG2)
(B-XOR FLG1 FLG2))
(EQUAL
(CONS
(CAR MSG)
(RECV
(LEN (CDR MSG))
(CSIG FLG1 (CAR MSG))
10
(APP
(DET (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))
(DET (WARP (CDRN (DWG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(SMOOTH (B-NOT (CSIG FLG1 (CAR MSG)))
(APP (CDR (CELLS (CSIG FLG1 (CAR MSG))
5 13
(CDR MSG)))
(LISTN P2 T))))
(TSG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
(TRG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
W R)
(ORACLE* (LISTN (NQG (NLST* (DIFFERENCE 17 DW) TS TR W R)
(NTS* (DIFFERENCE 17 DW) TS TR W R)
(NTR* (DIFFERENCE 17 DW) TS TR W R)
W R)
'Q)
(ORACLE* (WARP (SMOOTH FLG2
(CELL FLG1
(DIFFERENCE 4 DW)
13
(CAR MSG)))
TS TR W R)
ORACLE2))))))
MSG)),
which again simplifies, using linear arithmetic and rewriting with
DWG-BOUNDS, to:
T.
Q.E.D.
[ 0.0 2.4 0.0 ]
LOOP
(PROVE-LEMMA TOP NIL
(IMPLIES (AND (BVP MSG)
(NUMBERP TS)
(NUMBERP TR)
(NOT (ZEROP W))
(NOT (ZEROP R))
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(RATE-PROXIMITY W R)
(NUMBERP P1))
(EQUAL (RECV (LEN MSG)
T 10
(ASYNC (SEND MSG P1 5 13 P2)
TS TR W R ORACLE))
MSG))
((DISABLE ASYNC) (EXPAND (BVP MSG))))
This conjecture can be simplified, using the abbreviations RATE-PROXIMITY,
ZEROP, NOT, AND, and IMPLIES, to the formula:
(IMPLIES (AND (BVP MSG)
(NUMBERP TS)
(NUMBERP TR)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP TR TS))
(LESSP TR (PLUS TS W))
(NOT (LESSP (TIMES 18 W) (TIMES 17 R)))
(NOT (LESSP (TIMES 19 R) (TIMES 18 W)))
(NUMBERP P1))
(EQUAL (RECV (LEN MSG)
T 10
(ASYNC (SEND MSG P1 5 13 P2)
TS TR W R ORACLE))
MSG)).
This simplifies, using linear arithmetic, applying TOP-ASYNC-SEND, DWG-BOUNDS,
NQG-BOUNDS, LESSP-TRG*-PLUS-W-TSG*, PLUS-COMMUTES1, NOT-LESSP-TRG*-TSG*, LOOP,
and TOP-RECV-STEP, and unfolding the definitions of BVP, SUB1, NUMBERP, EQUAL,
TIMES, LEN, RECV, RATE-PROXIMITY, B-XOR, and BOOLP, to:
T.
Q.E.D.
[ 0.0 0.3 0.0 ]
TOP
(ENABLE NENDP-ALG)
[ 0.0 0.0 0.0 ]
NENDP-ALG-ON
(PROVE-LEMMA NTS*-ALG-LEMMA1
(REWRITE)
(IMPLIES (AND (NUMBERP X)
(EQUAL (TIMES N W) (PLUS R X))
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R))
(NOT (NENDP N TS (PLUS R TS X) W))))
This formula simplifies, using linear arithmetic and rewriting with the lemmas
PLUS-COMMUTES2 and NENDP-ALG, to the formula:
(IMPLIES (AND (NUMBERP X)
(EQUAL (TIMES N W) (PLUS R X))
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (EQUAL R 0))
(NUMBERP R))
(NOT (LESSP (PLUS R TS X) (PLUS R TS X)))).
But this again simplifies, using linear arithmetic, to:
T.
Q.E.D.
[ 0.0 0.0 0.0 ]
NTS*-ALG-LEMMA1
(PROVE-LEMMA NTS*-ALG-LEMMA2
(REWRITE)
(IMPLIES
(AND (NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (NENDP N TS (PLUS R TS X) W))
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL
(PLUS
(NTS+ N TS (PLUS R TS X) W)
(TIMES W
(QUOTIENT
(DIFFERENCE
(PLUS R TS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES W (NLST+ N TS (PLUS R TS X) W))
(DIFFERENCE (PLUS R TS X)
(NTS+ N TS (PLUS R TS X) W)))
R)))
(NTS+ N TS (PLUS R TS X) W))
W)))
(PLUS TS
(TIMES W
(QUOTIENT (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
W)))))
((ENABLE NLST+-ALG NTS+-ALG)))
WARNING: the previously added lemma, PLUS-COMMUTES1, could be applied
whenever the newly proposed NTS*-ALG-LEMMA2 could!
This conjecture simplifies, using linear arithmetic and rewriting with the
lemmas NENDP-ALG, DIFFERENCE-PLUS-CANCELLATION3, NTS+-ALG, NLST+-ALG,
DIFFERENCE-PLUS-CANCELLATION-4, NOT-LESSP-TIMES-QUOTIENT, PLUS-COMMUTES1,
DIFFERENCE-DIFFERENCE, QUOTIENT-DIFFERENCE, PLUS-ASSOCIATES,
TIMES-CANCELLATION2, and PLUS-CANCELLATION, to:
(IMPLIES
(AND (NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS (TIMES N W))
(PLUS R TS X)))
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL
(PLUS
(QUOTIENT (PLUS R X) W)
(DIFFERENCE
(QUOTIENT
(PLUS R X
(TIMES R
(QUOTIENT
(DIFFERENCE (PLUS (TIMES W (QUOTIENT (PLUS R X) W))
(TIMES W
(DIFFERENCE N
(QUOTIENT (PLUS R X) W))))
(PLUS R X))
R)))
W)
(QUOTIENT (PLUS R X) W)))
(QUOTIENT (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
W))).
Applying the lemma DIFFERENCE-ELIM, replace N by:
(PLUS (QUOTIENT (PLUS R X) W) Z)
to eliminate (DIFFERENCE N (QUOTIENT (PLUS R X) W)). We rely upon the type
restriction lemma noted when DIFFERENCE was introduced to restrict the new
variable. This produces the following two new formulas:
Case 2. (IMPLIES
(AND (LESSP N (QUOTIENT (PLUS R X) W))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS (TIMES N W))
(PLUS R TS X)))
(NUMBERP N)
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL
(PLUS
(QUOTIENT (PLUS R X) W)
(DIFFERENCE
(QUOTIENT
(PLUS R X
(TIMES R
(QUOTIENT
(DIFFERENCE (PLUS (TIMES W (QUOTIENT (PLUS R X) W))
(TIMES W
(DIFFERENCE N
(QUOTIENT (PLUS R X) W))))
(PLUS R X))
R)))
W)
(QUOTIENT (PLUS R X) W)))
(QUOTIENT (PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES N W) X)
R)))
W))).
This further simplifies, using linear arithmetic, rewriting with
DIFFERENCE-IS-0, TIMES-COMMUTES1, PLUS-COMMUTES1, NOT-LESSP-TIMES-QUOTIENT,
and NTS*-ALG-LEMMA2-HACK1, and unfolding the definitions of EQUAL, TIMES,
PLUS, LESSP, and QUOTIENT, to:
T.
Case 1. (IMPLIES
(AND (NUMBERP Z)
(NOT (LESSP (PLUS (QUOTIENT (PLUS R X) W) Z)
(QUOTIENT (PLUS R X) W)))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS
(TIMES (PLUS (QUOTIENT (PLUS R X) W) Z)
W))
(PLUS R TS X)))
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL
(PLUS
(QUOTIENT (PLUS R X) W)
(DIFFERENCE
(QUOTIENT
(PLUS R X
(TIMES R
(QUOTIENT (DIFFERENCE (PLUS (TIMES W (QUOTIENT (PLUS R X) W))
(TIMES W Z))
(PLUS R X))
R)))
W)
(QUOTIENT (PLUS R X) W)))
(QUOTIENT
(PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (TIMES (PLUS (QUOTIENT (PLUS R X) W) Z)
W)
X)
R)))
W))).
This further simplifies, applying PLUS-COMMUTES1, TIMES-COMMUTES1, and
TIMES-DISTRIBUTES2, to the new goal:
(IMPLIES
(AND (NUMBERP Z)
(NOT (LESSP (PLUS Z (QUOTIENT (PLUS R X) W))
(QUOTIENT (PLUS R X) W)))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS
(TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R TS X)))
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W)))
(EQUAL
(PLUS
(QUOTIENT (PLUS R X) W)
(DIFFERENCE
(QUOTIENT
(PLUS R X
(TIMES R
(QUOTIENT (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R X))
R)))
W)
(QUOTIENT (PLUS R X) W)))
(QUOTIENT
(PLUS X
(TIMES R
(QUOTIENT (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
X)
R)))
W))),
which again simplifies, applying DIFFERENCE-DIFFERENCE-OTHER and
PLUS-COMMUTES1, and unfolding QUOTIENT, to the following two new conjectures:
Case 1.2.
(IMPLIES
(AND
(NUMBERP Z)
(NOT (LESSP (PLUS Z (QUOTIENT (PLUS R X) W))
(QUOTIENT (PLUS R X) W)))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS
(TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R TS X)))
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W))
(NOT (LESSP (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
X)
R)))
(EQUAL
(PLUS
(QUOTIENT (PLUS R X) W)
(DIFFERENCE
(QUOTIENT
(PLUS R X
(TIMES R
(QUOTIENT (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R X))
R)))
W)
(QUOTIENT (PLUS R X) W)))
(QUOTIENT
(PLUS X
(TIMES R
(ADD1
(QUOTIENT (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R X))
R))))
W))).
This again simplifies, appealing to the lemmas TIMES-ADD1 and
PLUS-COMMUTES2, to the goal:
(IMPLIES
(AND
(NUMBERP Z)
(NOT (LESSP (PLUS Z (QUOTIENT (PLUS R X) W))
(QUOTIENT (PLUS R X) W)))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS
(TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R TS X)))
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W))
(NOT (LESSP (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
X)
R)))
(EQUAL
(PLUS
(QUOTIENT (PLUS R X) W)
(DIFFERENCE
(QUOTIENT
(PLUS R X
(TIMES R
(QUOTIENT (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R X))
R)))
W)
(QUOTIENT (PLUS R X) W)))
(QUOTIENT
(PLUS R X
(TIMES R
(QUOTIENT (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R X))
R)))
W))).
But this again simplifies, using linear arithmetic, to:
(IMPLIES
(AND
(LESSP
(QUOTIENT
(PLUS R X
(TIMES R
(QUOTIENT (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R X))
R)))
W)
(QUOTIENT (PLUS R X) W))
(NUMBERP Z)
(NOT (LESSP (PLUS Z (QUOTIENT (PLUS R X) W))
(QUOTIENT (PLUS R X) W)))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS
(TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R TS X)))
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W))
(NOT (LESSP (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
X)
R)))
(EQUAL
(PLUS
(QUOTIENT (PLUS R X) W)
(DIFFERENCE
(QUOTIENT
(PLUS R X
(TIMES R
(QUOTIENT (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R X))
R)))
W)
(QUOTIENT (PLUS R X) W)))
(QUOTIENT
(PLUS R X
(TIMES R
(QUOTIENT (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R X))
R)))
W))).
However this again simplifies, using linear arithmetic, applying
TIMES-COMMUTES1, LESSP-QUOTIENT-TO-LESSP-TIMES, DIFFERENCE-IS-0, and
PLUS-COMMUTES1, and opening up EQUAL and PLUS, to:
(IMPLIES
(AND
(LESSP
(PLUS R X
(TIMES R
(QUOTIENT (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R X))
R)))
(TIMES W (QUOTIENT (PLUS R X) W)))
(NUMBERP Z)
(NOT (LESSP (PLUS Z (QUOTIENT (PLUS R X) W))
(QUOTIENT (PLUS R X) W)))
(NUMBERP X)
(NOT (EQUAL R 0))
(NUMBERP R)
(NOT (LESSP (PLUS TS
(TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R TS X)))
(NUMBERP TS)
(NOT (EQUAL W 0))
(NUMBERP W)
(NOT (LESSP (PLUS TS X) TS))
(LESSP (PLUS TS X) (PLUS TS W))
(NOT (LESSP (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
X)
R)))
(EQUAL
(QUOTIENT (PLUS R X) W)
(QUOTIENT
(PLUS R X
(TIMES R
(QUOTIENT (DIFFERENCE (PLUS (TIMES W Z)
(TIMES W (QUOTIENT (PLUS R X) W)))
(PLUS R X))
R)))
W))),
which finally simplifies, using linear arithmetic and rewriting with the
lemma NOT-LESSP-TIMES-QUOTIENT, to:
T.
Case 1.1.
(IMPLIES
(AND (NUMBERP Z)
(NOT (LESSP (PLUS Z (QUOTIENT (PLUS R X) W))
(QUOTIENT (PLU