ACL2 >(cons 2 nil) (2) ACL2 >(cons 1 (cons 2 nil)) (1 2) ACL2 >(if t 1 2) 1 ACL2 >(if nil 1 2) 2 ACL2 >(nth 2 '(a b c d e)) C ACL2 >(update-nth 2 'h '(a b c d e)) (A B H D E) ACL2 >(defun app (x y) (if (endp x) y (cons (car x) (app (cdr x) y)))) The admission of APP is trivial, using the relation O< (which is known to be well-founded on the domain recognized by O-P) and the measure (ACL2-COUNT X). We observe that the type of APP is described by the theorem (OR (CONSP (APP X Y)) (EQUAL (APP X Y) Y)). We used primitive type reasoning. Summary Form: ( DEFUN APP ...) Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL)) Warnings: None Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01) APP ACL2 >(app '(1 2 3) '(4 5 6)) (1 2 3 4 5 6) ACL2 >(defthm app-is-associative (equal (app (app a b) c) (app a (app b c)))) Name the formula above *1. Perhaps we can prove *1 by induction. Three induction schemes are suggested by this conjecture. Subsumption reduces that number to two. However, one of these is flawed and so we are left with one viable candidate. We will induct according to a scheme suggested by (APP A B). This suggestion was produced using the :induction rule APP. If we let (:P A B C) denote *1 above then the induction scheme we'll use is (AND (IMPLIES (AND (NOT (ENDP A)) (:P (CDR A) B C)) (:P A B C)) (IMPLIES (ENDP A) (:P A B C))). This induction is justified by the same argument used to admit APP. When applied to the goal at hand the above induction scheme produces two nontautological subgoals. Subgoal *1/2 (IMPLIES (AND (NOT (ENDP 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)))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1/2' (IMPLIES (AND (CONSP 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)))). But simplification reduces this to T, using the :definition APP, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS. Subgoal *1/1 (IMPLIES (ENDP A) (EQUAL (APP (APP A B) C) (APP A (APP B C)))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1/1' (IMPLIES (NOT (CONSP A)) (EQUAL (APP (APP A B) C) (APP A (APP B C)))). But simplification reduces this to T, using the :definition APP and primitive type reasoning. That completes the proof of *1. Q.E.D. Summary Form: ( DEFTHM APP-IS-ASSOCIATIVE ...) Rules: ((:DEFINITION APP) (:DEFINITION ENDP) (:DEFINITION NOT) (:FAKE-RUNE-FOR-TYPE-SET NIL) (:INDUCTION APP) (:REWRITE CAR-CONS) (:REWRITE CDR-CONS)) Warnings: None Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.00) APP-IS-ASSOCIATIVE ACL2 >(quote (End of Demo 1)) (END OF DEMO 1) ACL2 >(defun insert (e x) (if (endp x) (cons e x) (if (lexorder e (car x)) (cons e x) (cons (car x) (insert e (cdr x)))))) The admission of INSERT is trivial, using the relation O< (which is known to be well-founded on the domain recognized by O-P) and the measure (ACL2-COUNT X). We observe that the type of INSERT is described by the theorem (CONSP (INSERT E X)). We used primitive type reasoning. Summary Form: ( DEFUN INSERT ...) Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL)) Warnings: None Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01) INSERT ACL2 >(insert 3 '(1 2 4 5)) (1 2 3 4 5) ACL2 >(insert 'bravo '(alpha charlie dog)) (ALPHA BRAVO CHARLIE DOG) ACL2 >(defun isort (x) (if (endp x) x (insert (car x) (isort (cdr x))))) The admission of ISORT is trivial, using the relation O< (which is known to be well-founded on the domain recognized by O-P) and the measure (ACL2-COUNT X). We could deduce no constraints on the type of ISORT. Summary Form: ( DEFUN ISORT ...) Rules: NIL Warnings: None Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.00) ISORT ACL2 >(isort '(5 1 3 2 4)) (1 2 3 4 5) ACL2 >(isort '(charlie alpha dog bravo)) (ALPHA BRAVO CHARLIE DOG) ACL2 >(defun orderedp (x) (if (endp x) t (if (endp (cdr x)) t (and (lexorder (car x) (car (cdr x))) (orderedp (cdr x)))))) The admission of ORDEREDP is trivial, using the relation O< (which is known to be well-founded on the domain recognized by O-P) and the measure (ACL2-COUNT X). We observe that the type of ORDEREDP is described by the theorem (OR (EQUAL (ORDEREDP X) T) (EQUAL (ORDEREDP X) NIL)). Summary Form: ( DEFUN ORDEREDP ...) Rules: NIL Warnings: None Time: 0.01 seconds (prove: 0.00, print: 0.00, other: 0.01) ORDEREDP ACL2 >(orderedp '(1 2 3 3 4 5)) T ACL2 >(orderedp '(1 2 3 4 3 5)) NIL ACL2 >(defthm orderedp-isort (orderedp (isort x))) Name the formula above *1. Perhaps we can prove *1 by induction. One induction scheme is suggested by this conjecture. We will induct according to a scheme suggested by (ISORT X). This suggestion was produced using the :induction rule ISORT. If we let (:P X) denote *1 above then the induction scheme we'll use is (AND (IMPLIES (AND (NOT (ENDP X)) (:P (CDR X))) (:P X)) (IMPLIES (ENDP X) (:P X))). This induction is justified by the same argument used to admit ISORT. When applied to the goal at hand the above induction scheme produces two nontautological subgoals. Subgoal *1/2 (IMPLIES (AND (NOT (ENDP X)) (ORDEREDP (ISORT (CDR X)))) (ORDEREDP (ISORT X))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1/2' (IMPLIES (AND (CONSP X) (ORDEREDP (ISORT (CDR X)))) (ORDEREDP (ISORT X))). This simplifies, using the :definition ISORT, to Subgoal *1/2'' (IMPLIES (AND (CONSP X) (ORDEREDP (ISORT (CDR X)))) (ORDEREDP (INSERT (CAR X) (ISORT (CDR X))))). The destructor terms (CAR X) and (CDR X) can be eliminated by using CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X) by X2. This produces the following goal. Subgoal *1/2''' (IMPLIES (AND (CONSP (CONS X1 X2)) (ORDEREDP (ISORT X2))) (ORDEREDP (INSERT X1 (ISORT X2)))). This simplifies, using primitive type reasoning, to Subgoal *1/2'4' (IMPLIES (ORDEREDP (ISORT X2)) (ORDEREDP (INSERT X1 (ISORT X2)))). We generalize this conjecture, replacing (ISORT X2) by IT. This produces Subgoal *1/2'5' (IMPLIES (ORDEREDP IT) (ORDEREDP (INSERT X1 IT))). Name the formula above *1.1. Subgoal *1/1 (IMPLIES (ENDP X) (ORDEREDP (ISORT X))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1/1' (IMPLIES (NOT (CONSP X)) (ORDEREDP (ISORT X))). But simplification reduces this to T, using the :definitions ISORT and ORDEREDP. So we now return to *1.1, which is (IMPLIES (ORDEREDP IT) (ORDEREDP (INSERT X1 IT))). Perhaps we can prove *1.1 by induction. Two induction schemes are suggested by this conjecture. These merge into one derived induction scheme. We will induct according to a scheme suggested by (INSERT X1 IT). This suggestion was produced using the :induction rules INSERT and ORDEREDP. If we let (:P IT X1) denote *1.1 above then the induction scheme we'll use is (AND (IMPLIES (AND (NOT (ENDP IT)) (NOT (LEXORDER X1 (CAR IT))) (:P (CDR IT) X1)) (:P IT X1)) (IMPLIES (AND (NOT (ENDP IT)) (LEXORDER X1 (CAR IT))) (:P IT X1)) (IMPLIES (ENDP IT) (:P IT X1))). This induction is justified by the same argument used to admit INSERT. When applied to the goal at hand the above induction scheme produces four nontautological subgoals. Subgoal *1.1/4 (IMPLIES (AND (NOT (ENDP IT)) (NOT (LEXORDER X1 (CAR IT))) (ORDEREDP (INSERT X1 (CDR IT))) (ORDEREDP IT)) (ORDEREDP (INSERT X1 IT))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1/4' (IMPLIES (AND (CONSP IT) (NOT (LEXORDER X1 (CAR IT))) (ORDEREDP (INSERT X1 (CDR IT))) (ORDEREDP IT)) (ORDEREDP (INSERT X1 IT))). This simplifies, using the :definitions INSERT and ORDEREDP, primitive type reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type- prescription rules INSERT, LEXORDER and ORDEREDP, to the following two conjectures. Subgoal *1.1/4.2 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER X1 (CAR IT))) (ORDEREDP (INSERT X1 (CDR IT))) (NOT (CONSP (CDR IT)))) (LEXORDER (CAR IT) (CAR (INSERT X1 (CDR IT))))). But simplification reduces this to T, using the :definitions INSERT and ORDEREDP, primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1/4.1 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER X1 (CAR IT))) (ORDEREDP (INSERT X1 (CDR IT))) (LEXORDER (CAR IT) (CADR IT)) (ORDEREDP (CDR IT))) (LEXORDER (CAR IT) (CAR (INSERT X1 (CDR IT))))). The destructor terms (CAR IT) and (CDR IT) can be eliminated. Furthermore, those terms are at the root of a chain of two rounds of destructor elimination. (1) Use CAR-CDR-ELIM to replace IT by (CONS IT1 IT2), (CAR IT) by IT1 and (CDR IT) by IT2. (2) Use CAR-CDR-ELIM, again, to replace IT2 by (CONS IT3 IT4), (CAR IT2) by IT3 and (CDR IT2) by IT4. These steps produce the following two goals. Subgoal *1.1/4.1.2 (IMPLIES (AND (NOT (CONSP IT2)) (CONSP (CONS IT1 IT2)) (NOT (LEXORDER X1 IT1)) (ORDEREDP (INSERT X1 IT2)) (LEXORDER IT1 (CAR IT2)) (ORDEREDP IT2)) (LEXORDER IT1 (CAR (INSERT X1 IT2)))). But simplification reduces this to T, using the :definitions INSERT and ORDEREDP, primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS, DEFAULT-CAR, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1/4.1.1 (IMPLIES (AND (CONSP (CONS IT3 IT4)) (CONSP (LIST* IT1 IT3 IT4)) (NOT (LEXORDER X1 IT1)) (ORDEREDP (INSERT X1 (CONS IT3 IT4))) (LEXORDER IT1 IT3) (ORDEREDP (CONS IT3 IT4))) (LEXORDER IT1 (CAR (INSERT X1 (CONS IT3 IT4))))). But simplification reduces this to T, using the :definitions INSERT and ORDEREDP, primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1/3 (IMPLIES (AND (NOT (ENDP IT)) (NOT (LEXORDER X1 (CAR IT))) (NOT (ORDEREDP (CDR IT))) (ORDEREDP IT)) (ORDEREDP (INSERT X1 IT))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1/3' (IMPLIES (AND (CONSP IT) (NOT (LEXORDER X1 (CAR IT))) (NOT (ORDEREDP (CDR IT))) (ORDEREDP IT)) (ORDEREDP (INSERT X1 IT))). This simplifies, using the :definitions INSERT and ORDEREDP, primitive type reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type- prescription rule INSERT, to the following two conjectures. Subgoal *1.1/3.2 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER X1 (CAR IT))) (NOT (ORDEREDP (CDR IT))) (NOT (CONSP (CDR IT)))) (LEXORDER (CAR IT) (CAR (INSERT X1 (CDR IT))))). But simplification reduces this to T, using the :definition ORDEREDP. Subgoal *1.1/3.1 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER X1 (CAR IT))) (NOT (ORDEREDP (CDR IT))) (NOT (CONSP (CDR IT)))) (ORDEREDP (INSERT X1 (CDR IT)))). But simplification reduces this to T, using the :definition ORDEREDP. Subgoal *1.1/2 (IMPLIES (AND (NOT (ENDP IT)) (LEXORDER X1 (CAR IT)) (ORDEREDP IT)) (ORDEREDP (INSERT X1 IT))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1/2' (IMPLIES (AND (CONSP IT) (LEXORDER X1 (CAR IT)) (ORDEREDP IT)) (ORDEREDP (INSERT X1 IT))). But simplification reduces this to T, using the :definitions INSERT and ORDEREDP, primitive type reasoning, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type- prescription rules LEXORDER and ORDEREDP. Subgoal *1.1/1 (IMPLIES (AND (ENDP IT) (ORDEREDP IT)) (ORDEREDP (INSERT X1 IT))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1/1' (IMPLIES (AND (NOT (CONSP IT)) (ORDEREDP IT)) (ORDEREDP (INSERT X1 IT))). But simplification reduces this to T, using the :definitions INSERT and ORDEREDP, primitive type reasoning and the :rewrite rule CDR-CONS. That completes the proofs of *1.1 and *1. Q.E.D. The storage of ORDEREDP-ISORT depends upon the :type-prescription rule ORDEREDP. Summary Form: ( DEFTHM ORDEREDP-ISORT ...) Rules: ((:DEFINITION ENDP) (:DEFINITION INSERT) (:DEFINITION ISORT) (:DEFINITION NOT) (:DEFINITION ORDEREDP) (:ELIM CAR-CDR-ELIM) (:FAKE-RUNE-FOR-TYPE-SET NIL) (:FORWARD-CHAINING LEXORDER-TOTAL) (:INDUCTION INSERT) (:INDUCTION ISORT) (:INDUCTION ORDEREDP) (:REWRITE CAR-CONS) (:REWRITE CDR-CONS) (:REWRITE DEFAULT-CAR) (:REWRITE LEXORDER-REFLEXIVE) (:REWRITE LEXORDER-TRANSITIVE) (:TYPE-PRESCRIPTION INSERT) (:TYPE-PRESCRIPTION LEXORDER) (:TYPE-PRESCRIPTION ORDEREDP)) Warnings: None Time: 0.02 seconds (prove: 0.02, print: 0.01, other: 0.00) ORDEREDP-ISORT ACL2 >(defthm isort-isort (equal (isort (isort x)) (isort x))) Name the formula above *1. Perhaps we can prove *1 by induction. Two induction schemes are suggested by this conjecture. Subsumption reduces that number to one. We will induct according to a scheme suggested by (ISORT X). This suggestion was produced using the :induction rule ISORT. If we let (:P X) denote *1 above then the induction scheme we'll use is (AND (IMPLIES (AND (NOT (ENDP X)) (:P (CDR X))) (:P X)) (IMPLIES (ENDP X) (:P X))). This induction is justified by the same argument used to admit ISORT. When applied to the goal at hand the above induction scheme produces two nontautological subgoals. Subgoal *1/2 (IMPLIES (AND (NOT (ENDP X)) (EQUAL (ISORT (ISORT (CDR X))) (ISORT (CDR X)))) (EQUAL (ISORT (ISORT X)) (ISORT X))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1/2' (IMPLIES (AND (CONSP X) (EQUAL (ISORT (ISORT (CDR X))) (ISORT (CDR X)))) (EQUAL (ISORT (ISORT X)) (ISORT X))). This simplifies, using the :definition ISORT, to Subgoal *1/2'' (IMPLIES (AND (CONSP X) (EQUAL (ISORT (ISORT (CDR X))) (ISORT (CDR X)))) (EQUAL (ISORT (INSERT (CAR X) (ISORT (CDR X)))) (INSERT (CAR X) (ISORT (CDR X))))). The destructor terms (CAR X) and (CDR X) can be eliminated by using CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X) by X2. This produces the following goal. Subgoal *1/2''' (IMPLIES (AND (CONSP (CONS X1 X2)) (EQUAL (ISORT (ISORT X2)) (ISORT X2))) (EQUAL (ISORT (INSERT X1 (ISORT X2))) (INSERT X1 (ISORT X2)))). This simplifies, using primitive type reasoning, to Subgoal *1/2'4' (IMPLIES (EQUAL (ISORT (ISORT X2)) (ISORT X2)) (EQUAL (ISORT (INSERT X1 (ISORT X2))) (INSERT X1 (ISORT X2)))). We now use the hypothesis by cross-fertilizing (ISORT (ISORT X2)) for (ISORT X2) and throwing away the hypothesis. This produces Subgoal *1/2'5' (EQUAL (ISORT (INSERT X1 (ISORT X2))) (INSERT X1 (ISORT (ISORT X2)))). We generalize this conjecture, replacing (ISORT X2) by IT. This produces Subgoal *1/2'6' (EQUAL (ISORT (INSERT X1 IT)) (INSERT X1 (ISORT IT))). Name the formula above *1.1. Subgoal *1/1 (IMPLIES (ENDP X) (EQUAL (ISORT (ISORT X)) (ISORT X))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1/1' (IMPLIES (NOT (CONSP X)) (EQUAL (ISORT (ISORT X)) (ISORT X))). But simplification reduces this to T, using the :definition ISORT and primitive type reasoning. So we now return to *1.1, which is (EQUAL (ISORT (INSERT X1 IT)) (INSERT X1 (ISORT IT))). Perhaps we can prove *1.1 by induction. Two induction schemes are suggested by this conjecture. Subsumption reduces that number to one. We will induct according to a scheme suggested by (INSERT X1 IT). This suggestion was produced using the :induction rules INSERT and ISORT. If we let (:P IT X1) denote *1.1 above then the induction scheme we'll use is (AND (IMPLIES (AND (NOT (ENDP IT)) (NOT (LEXORDER X1 (CAR IT))) (:P (CDR IT) X1)) (:P IT X1)) (IMPLIES (AND (NOT (ENDP IT)) (LEXORDER X1 (CAR IT))) (:P IT X1)) (IMPLIES (ENDP IT) (:P IT X1))). This induction is justified by the same argument used to admit INSERT. When applied to the goal at hand the above induction scheme produces three nontautological subgoals. Subgoal *1.1/3 (IMPLIES (AND (NOT (ENDP IT)) (NOT (LEXORDER X1 (CAR IT))) (EQUAL (ISORT (INSERT X1 (CDR IT))) (INSERT X1 (ISORT (CDR IT))))) (EQUAL (ISORT (INSERT X1 IT)) (INSERT X1 (ISORT IT)))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1/3' (IMPLIES (AND (CONSP IT) (NOT (LEXORDER X1 (CAR IT))) (EQUAL (ISORT (INSERT X1 (CDR IT))) (INSERT X1 (ISORT (CDR IT))))) (EQUAL (ISORT (INSERT X1 IT)) (INSERT X1 (ISORT IT)))). This simplifies, using the :definitions INSERT and ISORT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to Subgoal *1.1/3'' (IMPLIES (AND (CONSP IT) (NOT (LEXORDER X1 (CAR IT))) (EQUAL (ISORT (INSERT X1 (CDR IT))) (INSERT X1 (ISORT (CDR IT))))) (EQUAL (INSERT (CAR IT) (INSERT X1 (ISORT (CDR IT)))) (INSERT X1 (INSERT (CAR IT) (ISORT (CDR IT)))))). The destructor terms (CAR IT) and (CDR IT) can be eliminated by using CAR-CDR-ELIM to replace IT by (CONS IT1 IT2), (CAR IT) by IT1 and (CDR IT) by IT2. This produces the following goal. Subgoal *1.1/3''' (IMPLIES (AND (CONSP (CONS IT1 IT2)) (NOT (LEXORDER X1 IT1)) (EQUAL (ISORT (INSERT X1 IT2)) (INSERT X1 (ISORT IT2)))) (EQUAL (INSERT IT1 (INSERT X1 (ISORT IT2))) (INSERT X1 (INSERT IT1 (ISORT IT2))))). This simplifies, using primitive type reasoning, to Subgoal *1.1/3'4' (IMPLIES (AND (NOT (LEXORDER X1 IT1)) (EQUAL (ISORT (INSERT X1 IT2)) (INSERT X1 (ISORT IT2)))) (EQUAL (INSERT IT1 (INSERT X1 (ISORT IT2))) (INSERT X1 (INSERT IT1 (ISORT IT2))))). We now use the second hypothesis by substituting (ISORT (INSERT X1 IT2)) for (INSERT X1 (ISORT IT2)) and throwing away the hypothesis. This produces Subgoal *1.1/3'5' (IMPLIES (NOT (LEXORDER X1 IT1)) (EQUAL (INSERT IT1 (ISORT (INSERT X1 IT2))) (INSERT X1 (INSERT IT1 (ISORT IT2))))). Name the formula above *1.1.1. Subgoal *1.1/2 (IMPLIES (AND (NOT (ENDP IT)) (LEXORDER X1 (CAR IT))) (EQUAL (ISORT (INSERT X1 IT)) (INSERT X1 (ISORT IT)))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1/2' (IMPLIES (AND (CONSP IT) (LEXORDER X1 (CAR IT))) (EQUAL (ISORT (INSERT X1 IT)) (INSERT X1 (ISORT IT)))). This simplifies, using the :definitions INSERT and ISORT, the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER, to Subgoal *1.1/2'' (IMPLIES (AND (CONSP IT) (LEXORDER X1 (CAR IT))) (EQUAL (ISORT (CONS X1 IT)) (INSERT X1 (INSERT (CAR IT) (ISORT (CDR IT)))))). But simplification reduces this to T, using the :definition ISORT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS. Subgoal *1.1/1 (IMPLIES (ENDP IT) (EQUAL (ISORT (INSERT X1 IT)) (INSERT X1 (ISORT IT)))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1/1' (IMPLIES (NOT (CONSP IT)) (EQUAL (ISORT (INSERT X1 IT)) (INSERT X1 (ISORT IT)))). But simplification reduces this to T, using the :definitions INSERT and ISORT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS. So we now return to *1.1.1, which is (IMPLIES (NOT (LEXORDER X1 IT1)) (EQUAL (INSERT IT1 (ISORT (INSERT X1 IT2))) (INSERT X1 (INSERT IT1 (ISORT IT2))))). Perhaps we can prove *1.1.1 by induction. Two induction schemes are suggested by this conjecture. Subsumption reduces that number to one. We will induct according to a scheme suggested by (INSERT X1 IT2). This suggestion was produced using the :induction rules INSERT and ISORT. If we let (:P IT1 IT2 X1) denote *1.1.1 above then the induction scheme we'll use is (AND (IMPLIES (AND (NOT (ENDP IT2)) (NOT (LEXORDER X1 (CAR IT2))) (:P IT1 (CDR IT2) X1)) (:P IT1 IT2 X1)) (IMPLIES (AND (NOT (ENDP IT2)) (LEXORDER X1 (CAR IT2))) (:P IT1 IT2 X1)) (IMPLIES (ENDP IT2) (:P IT1 IT2 X1))). This induction is justified by the same argument used to admit INSERT. When applied to the goal at hand the above induction scheme produces three nontautological subgoals. Subgoal *1.1.1/3 (IMPLIES (AND (NOT (ENDP IT2)) (NOT (LEXORDER X1 (CAR IT2))) (EQUAL (INSERT IT1 (ISORT (INSERT X1 (CDR IT2)))) (INSERT X1 (INSERT IT1 (ISORT (CDR IT2))))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (ISORT (INSERT X1 IT2))) (INSERT X1 (INSERT IT1 (ISORT IT2))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1/3' (IMPLIES (AND (CONSP IT2) (NOT (LEXORDER X1 (CAR IT2))) (EQUAL (INSERT IT1 (ISORT (INSERT X1 (CDR IT2)))) (INSERT X1 (INSERT IT1 (ISORT (CDR IT2))))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (ISORT (INSERT X1 IT2))) (INSERT X1 (INSERT IT1 (ISORT IT2))))). This simplifies, using the :definitions INSERT and ISORT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to Subgoal *1.1.1/3'' (IMPLIES (AND (CONSP IT2) (NOT (LEXORDER X1 (CAR IT2))) (EQUAL (INSERT IT1 (ISORT (INSERT X1 (CDR IT2)))) (INSERT X1 (INSERT IT1 (ISORT (CDR IT2))))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT (CAR IT2) (ISORT (INSERT X1 (CDR IT2))))) (INSERT X1 (INSERT IT1 (INSERT (CAR IT2) (ISORT (CDR IT2))))))). The destructor terms (CAR IT2) and (CDR IT2) can be eliminated by using CAR-CDR-ELIM to replace IT2 by (CONS IT3 IT4), (CAR IT2) by IT3 and (CDR IT2) by IT4. This produces the following goal. Subgoal *1.1.1/3''' (IMPLIES (AND (CONSP (CONS IT3 IT4)) (NOT (LEXORDER X1 IT3)) (EQUAL (INSERT IT1 (ISORT (INSERT X1 IT4))) (INSERT X1 (INSERT IT1 (ISORT IT4)))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT IT3 (ISORT (INSERT X1 IT4)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (ISORT IT4)))))). This simplifies, using primitive type reasoning, to Subgoal *1.1.1/3'4' (IMPLIES (AND (NOT (LEXORDER X1 IT3)) (EQUAL (INSERT IT1 (ISORT (INSERT X1 IT4))) (INSERT X1 (INSERT IT1 (ISORT IT4)))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT IT3 (ISORT (INSERT X1 IT4)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (ISORT IT4)))))). We generalize this conjecture, replacing (ISORT IT4) by IT and (INSERT X1 IT4) by L and restricting the type of the new variable L to be that of the term it replaces, as established by INSERT. This produces Subgoal *1.1.1/3'5' (IMPLIES (AND (CONSP L) (NOT (LEXORDER X1 IT3)) (EQUAL (INSERT IT1 (ISORT L)) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT IT3 (ISORT L))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). We generalize this conjecture, replacing (ISORT L) by IT0. This produces Subgoal *1.1.1/3'6' (IMPLIES (AND (CONSP L) (NOT (LEXORDER X1 IT3)) (EQUAL (INSERT IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT IT3 IT0)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). We suspect that the term (CONSP L) is irrelevant to the truth of this conjecture and throw it out. We will thus try to prove Subgoal *1.1.1/3'7' (IMPLIES (AND (NOT (LEXORDER X1 IT3)) (EQUAL (INSERT IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT IT3 IT0)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). Name the formula above *1.1.1.1. Subgoal *1.1.1/2 (IMPLIES (AND (NOT (ENDP IT2)) (LEXORDER X1 (CAR IT2)) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (ISORT (INSERT X1 IT2))) (INSERT X1 (INSERT IT1 (ISORT IT2))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1/2' (IMPLIES (AND (CONSP IT2) (LEXORDER X1 (CAR IT2)) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (ISORT (INSERT X1 IT2))) (INSERT X1 (INSERT IT1 (ISORT IT2))))). This simplifies, using the :definitions INSERT and ISORT, the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER, to Subgoal *1.1.1/2'' (IMPLIES (AND (CONSP IT2) (LEXORDER X1 (CAR IT2)) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (ISORT (CONS X1 IT2))) (INSERT X1 (INSERT IT1 (INSERT (CAR IT2) (ISORT (CDR IT2))))))). This simplifies, using the :definition ISORT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to Subgoal *1.1.1/2''' (IMPLIES (AND (CONSP IT2) (LEXORDER X1 (CAR IT2)) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT X1 (INSERT (CAR IT2) (ISORT (CDR IT2))))) (INSERT X1 (INSERT IT1 (INSERT (CAR IT2) (ISORT (CDR IT2))))))). The destructor terms (CAR IT2) and (CDR IT2) can be eliminated by using CAR-CDR-ELIM to replace IT2 by (CONS IT3 IT4), (CAR IT2) by IT3 and (CDR IT2) by IT4. This produces the following goal. Subgoal *1.1.1/2'4' (IMPLIES (AND (CONSP (CONS IT3 IT4)) (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT X1 (INSERT IT3 (ISORT IT4)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (ISORT IT4)))))). This simplifies, using primitive type reasoning, to Subgoal *1.1.1/2'5' (IMPLIES (AND (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT X1 (INSERT IT3 (ISORT IT4)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (ISORT IT4)))))). We generalize this conjecture, replacing (ISORT IT4) by IT. This produces Subgoal *1.1.1/2'6' (IMPLIES (AND (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT X1 (INSERT IT3 IT))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). We generalize this conjecture, replacing (INSERT IT3 IT) by L and restricting the type of the new variable L to be that of the term it replaces, as established by INSERT. This produces Subgoal *1.1.1/2'7' (IMPLIES (AND (CONSP L) (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT X1 L)) (INSERT X1 (INSERT IT1 L)))). Name the formula above *1.1.1.2. Subgoal *1.1.1/1 (IMPLIES (AND (ENDP IT2) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (ISORT (INSERT X1 IT2))) (INSERT X1 (INSERT IT1 (ISORT IT2))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1/1' (IMPLIES (AND (NOT (CONSP IT2)) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (ISORT (INSERT X1 IT2))) (INSERT X1 (INSERT IT1 (ISORT IT2))))). But simplification reduces this to T, using the :definitions INSERT and ISORT, primitive type reasoning, the :forward-chaining rule LEXORDER- TOTAL, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER. So we now return to *1.1.1.2, which is (IMPLIES (AND (CONSP L) (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT X1 L)) (INSERT X1 (INSERT IT1 L)))). Perhaps we can prove *1.1.1.2 by induction. Two induction schemes are suggested by this conjecture. These merge into one derived induction scheme. We will induct according to a scheme suggested by (INSERT IT1 L), but modified to accommodate (INSERT X1 L). These suggestions were produced using the :induction rule INSERT. If we let (:P IT1 IT3 L X1) denote *1.1.1.2 above then the induction scheme we'll use is (AND (IMPLIES (AND (NOT (ENDP L)) (NOT (LEXORDER IT1 (CAR L))) (:P IT1 IT3 (CDR L) X1)) (:P IT1 IT3 L X1)) (IMPLIES (AND (NOT (ENDP L)) (LEXORDER IT1 (CAR L))) (:P IT1 IT3 L X1)) (IMPLIES (ENDP L) (:P IT1 IT3 L X1))). This induction is justified by the same argument used to admit INSERT. When applied to the goal at hand the above induction scheme produces four nontautological subgoals. Subgoal *1.1.1.2/4 (IMPLIES (AND (NOT (ENDP L)) (NOT (LEXORDER IT1 (CAR L))) (EQUAL (INSERT IT1 (INSERT X1 (CDR L))) (INSERT X1 (INSERT IT1 (CDR L)))) (CONSP L) (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT X1 L)) (INSERT X1 (INSERT IT1 L)))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.2/4' (IMPLIES (AND (CONSP L) (NOT (LEXORDER IT1 (CAR L))) (EQUAL (INSERT IT1 (INSERT X1 (CDR L))) (INSERT X1 (INSERT IT1 (CDR L)))) (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT X1 L)) (INSERT X1 (INSERT IT1 L)))). This simplifies, using the :definition INSERT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to the following two conjectures. Subgoal *1.1.1.2/4.2 (IMPLIES (AND (CONSP L) (NOT (LEXORDER IT1 (CAR L))) (EQUAL (INSERT IT1 (INSERT X1 (CDR L))) (INSERT X1 (INSERT IT1 (CDR L)))) (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1)) (LEXORDER X1 (CAR L))) (EQUAL (INSERT IT1 (CONS X1 L)) (LIST* X1 (CAR L) (INSERT IT1 (CDR L))))). But simplification reduces this to T, using primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rule LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1.1.2/4.1 (IMPLIES (AND (CONSP L) (NOT (LEXORDER IT1 (CAR L))) (EQUAL (INSERT IT1 (INSERT X1 (CDR L))) (INSERT X1 (INSERT IT1 (CDR L)))) (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER X1 (CAR L)))) (EQUAL (INSERT IT1 (CONS (CAR L) (INSERT X1 (CDR L)))) (CONS (CAR L) (INSERT IT1 (INSERT X1 (CDR L)))))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS. Subgoal *1.1.1.2/3 (IMPLIES (AND (NOT (ENDP L)) (NOT (LEXORDER IT1 (CAR L))) (NOT (CONSP (CDR L))) (CONSP L) (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT X1 L)) (INSERT X1 (INSERT IT1 L)))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.2/3' (IMPLIES (AND (CONSP L) (NOT (LEXORDER IT1 (CAR L))) (NOT (CONSP (CDR L))) (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT X1 L)) (INSERT X1 (INSERT IT1 L)))). This simplifies, using the :definition INSERT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to the following two conjectures. Subgoal *1.1.1.2/3.2 (IMPLIES (AND (CONSP L) (NOT (LEXORDER IT1 (CAR L))) (NOT (CONSP (CDR L))) (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1)) (LEXORDER X1 (CAR L))) (EQUAL (INSERT IT1 (CONS X1 L)) (LIST* X1 (CAR L) (INSERT IT1 (CDR L))))). But simplification reduces this to T, using primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rule LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1.1.2/3.1 (IMPLIES (AND (CONSP L) (NOT (LEXORDER IT1 (CAR L))) (NOT (CONSP (CDR L))) (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER X1 (CAR L)))) (EQUAL (INSERT IT1 (CONS (CAR L) (INSERT X1 (CDR L)))) (CONS (CAR L) (INSERT X1 (INSERT IT1 (CDR L)))))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1.1.2/2 (IMPLIES (AND (NOT (ENDP L)) (LEXORDER IT1 (CAR L)) (CONSP L) (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT X1 L)) (INSERT X1 (INSERT IT1 L)))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.2/2' (IMPLIES (AND (CONSP L) (LEXORDER IT1 (CAR L)) (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT X1 L)) (INSERT X1 (INSERT IT1 L)))). This simplifies, using the :definition INSERT, the :rewrite rules LEXORDER- REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER, to the following two conjectures. Subgoal *1.1.1.2/2.2 (IMPLIES (AND (CONSP L) (LEXORDER IT1 (CAR L)) (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1)) (LEXORDER X1 (CAR L))) (EQUAL (INSERT IT1 (CONS X1 L)) (INSERT X1 (CONS IT1 L)))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1.1.2/2.1 (IMPLIES (AND (CONSP L) (LEXORDER IT1 (CAR L)) (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER X1 (CAR L)))) (EQUAL (INSERT IT1 (CONS (CAR L) (INSERT X1 (CDR L)))) (INSERT X1 (CONS IT1 L)))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER- REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1.1.2/1 (IMPLIES (AND (ENDP L) (CONSP L) (LEXORDER X1 IT3) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT X1 L)) (INSERT X1 (INSERT IT1 L)))). But we reduce the conjecture to T, by case analysis. That completes the proof of *1.1.1.2. We therefore turn our attention to *1.1.1.1, which is (IMPLIES (AND (NOT (LEXORDER X1 IT3)) (EQUAL (INSERT IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT IT3 IT0)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). Perhaps we can prove *1.1.1.1 by induction. Four induction schemes are suggested by this conjecture. These merge into two derived induction schemes. We will choose arbitrarily among these. We will induct according to a scheme suggested by (INSERT IT3 IT0), but modified to accommodate (INSERT IT1 IT0). These suggestions were produced using the :induction rule INSERT. If we let (:P IT IT0 IT1 IT3 X1) denote *1.1.1.1 above then the induction scheme we'll use is (AND (IMPLIES (AND (NOT (ENDP IT0)) (NOT (LEXORDER IT3 (CAR IT0))) (:P IT (CDR IT0) IT1 IT3 X1)) (:P IT IT0 IT1 IT3 X1)) (IMPLIES (AND (NOT (ENDP IT0)) (LEXORDER IT3 (CAR IT0))) (:P IT IT0 IT1 IT3 X1)) (IMPLIES (ENDP IT0) (:P IT IT0 IT1 IT3 X1))). This induction is justified by the same argument used to admit INSERT. When applied to the goal at hand the above induction scheme produces four nontautological subgoals. Subgoal *1.1.1.1/4 (IMPLIES (AND (NOT (ENDP IT0)) (NOT (LEXORDER IT3 (CAR IT0))) (EQUAL (INSERT IT1 (INSERT IT3 (CDR IT0))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT)))) (NOT (LEXORDER X1 IT3)) (EQUAL (INSERT IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT IT3 IT0)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1/4' (IMPLIES (AND (CONSP IT0) (NOT (LEXORDER IT3 (CAR IT0))) (EQUAL (INSERT IT1 (INSERT IT3 (CDR IT0))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT)))) (NOT (LEXORDER X1 IT3)) (EQUAL (INSERT IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT IT3 IT0)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using the :definition INSERT, primitive type reasoning, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER, to the following two conjectures. Subgoal *1.1.1.1/4.2 (IMPLIES (AND (CONSP IT0) (NOT (LEXORDER IT3 (CAR IT0))) (EQUAL (INSERT IT1 (INSERT IT3 (CDR IT0))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT)))) (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 (CAR IT0)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (LIST* IT1 (CAR IT0) (INSERT IT3 (CDR IT0))) (INSERT IT1 (INSERT IT3 (CDR IT0))))). The destructor terms (CAR IT0) and (CDR IT0) can be eliminated by using CAR-CDR-ELIM to replace IT0 by (CONS IT2 IT4), (CAR IT0) by IT2 and (CDR IT0) by IT4. This produces the following goal. Subgoal *1.1.1.1/4.2' (IMPLIES (AND (CONSP (CONS IT2 IT4)) (NOT (LEXORDER IT3 IT2)) (EQUAL (INSERT IT1 (INSERT IT3 IT4)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT)))) (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 IT2) (EQUAL (LIST* IT1 IT2 IT4) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (LIST* IT1 IT2 (INSERT IT3 IT4)) (INSERT IT1 (INSERT IT3 IT4)))). This simplifies, using primitive type reasoning, to Subgoal *1.1.1.1/4.2'' (IMPLIES (AND (NOT (LEXORDER IT3 IT2)) (EQUAL (INSERT IT1 (INSERT IT3 IT4)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT)))) (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 IT2) (EQUAL (LIST* IT1 IT2 IT4) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (LIST* IT1 IT2 (INSERT IT3 IT4)) (INSERT IT1 (INSERT IT3 IT4)))). We now use the second hypothesis by substituting (INSERT X1 (INSERT IT1 (INSERT IT3 IT))) for (INSERT IT1 (INSERT IT3 IT4)) and throwing away the hypothesis. This produces Subgoal *1.1.1.1/4.2''' (IMPLIES (AND (NOT (LEXORDER IT3 IT2)) (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 IT2) (EQUAL (LIST* IT1 IT2 IT4) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (LIST* IT1 IT2 (INSERT IT3 IT4)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). Name the formula above *1.1.1.1.1. Subgoal *1.1.1.1/4.1 (IMPLIES (AND (CONSP IT0) (NOT (LEXORDER IT3 (CAR IT0))) (EQUAL (INSERT IT1 (INSERT IT3 (CDR IT0))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT)))) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 (CAR IT0))) (EQUAL (CONS (CAR IT0) (INSERT IT1 (CDR IT0))) (INSERT X1 (INSERT IT1 IT)))) (LEXORDER X1 IT1)). The destructor terms (CAR IT0) and (CDR IT0) can be eliminated by using CAR-CDR-ELIM to replace IT0 by (CONS IT2 IT4), (CAR IT0) by IT2 and (CDR IT0) by IT4. This produces the following goal. Subgoal *1.1.1.1/4.1' (IMPLIES (AND (CONSP (CONS IT2 IT4)) (NOT (LEXORDER IT3 IT2)) (EQUAL (INSERT IT1 (INSERT IT3 IT4)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT)))) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (EQUAL (CONS IT2 (INSERT IT1 IT4)) (INSERT X1 (INSERT IT1 IT)))) (LEXORDER X1 IT1)). This simplifies, using primitive type reasoning, to Subgoal *1.1.1.1/4.1'' (IMPLIES (AND (NOT (LEXORDER IT3 IT2)) (EQUAL (INSERT IT1 (INSERT IT3 IT4)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT)))) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (EQUAL (CONS IT2 (INSERT IT1 IT4)) (INSERT X1 (INSERT IT1 IT)))) (LEXORDER X1 IT1)). Name the formula above *1.1.1.1.2. Subgoal *1.1.1.1/3 (IMPLIES (AND (NOT (ENDP IT0)) (NOT (LEXORDER IT3 (CAR IT0))) (NOT (EQUAL (INSERT IT1 (CDR IT0)) (INSERT X1 (INSERT IT1 IT)))) (NOT (LEXORDER X1 IT3)) (EQUAL (INSERT IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT IT3 IT0)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1/3' (IMPLIES (AND (CONSP IT0) (NOT (LEXORDER IT3 (CAR IT0))) (NOT (EQUAL (INSERT IT1 (CDR IT0)) (INSERT X1 (INSERT IT1 IT)))) (NOT (LEXORDER X1 IT3)) (EQUAL (INSERT IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT IT3 IT0)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using the :definition INSERT, primitive type reasoning, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER, to the following two conjectures. Subgoal *1.1.1.1/3.2 (IMPLIES (AND (CONSP IT0) (NOT (LEXORDER IT3 (CAR IT0))) (NOT (EQUAL (INSERT IT1 (CDR IT0)) (INSERT IT1 IT0))) (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 (CAR IT0)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (LIST* IT1 (CAR IT0) (INSERT IT3 (CDR IT0))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using the :definition INSERT, the :rewrite rules LEXORDER- REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER, to Subgoal *1.1.1.1/3.2' (IMPLIES (AND (CONSP IT0) (NOT (LEXORDER IT3 (CAR IT0))) (NOT (EQUAL (INSERT IT1 (CDR IT0)) (CONS IT1 IT0))) (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 (CAR IT0)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (LIST* IT1 (CAR IT0) (INSERT IT3 (CDR IT0))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). The destructor terms (CAR IT0) and (CDR IT0) can be eliminated by using CAR-CDR-ELIM to replace IT0 by (CONS IT2 IT4), (CAR IT0) by IT2 and (CDR IT0) by IT4. This produces the following goal. Subgoal *1.1.1.1/3.2'' (IMPLIES (AND (CONSP (CONS IT2 IT4)) (NOT (LEXORDER IT3 IT2)) (NOT (EQUAL (INSERT IT1 IT4) (LIST* IT1 IT2 IT4))) (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 IT2) (EQUAL (LIST* IT1 IT2 IT4) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (LIST* IT1 IT2 (INSERT IT3 IT4)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using primitive type reasoning, to Subgoal *1.1.1.1/3.2''' (IMPLIES (AND (NOT (LEXORDER IT3 IT2)) (NOT (EQUAL (INSERT IT1 IT4) (LIST* IT1 IT2 IT4))) (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 IT2) (EQUAL (LIST* IT1 IT2 IT4) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (LIST* IT1 IT2 (INSERT IT3 IT4)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). Name the formula above *1.1.1.1.3. Subgoal *1.1.1.1/3.1 (IMPLIES (AND (CONSP IT0) (NOT (LEXORDER IT3 (CAR IT0))) (NOT (EQUAL (INSERT IT1 (CDR IT0)) (INSERT IT1 IT0))) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 (CAR IT0))) (EQUAL (CONS (CAR IT0) (INSERT IT1 (CDR IT0))) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (CONS (CAR IT0) (INSERT IT1 (INSERT IT3 (CDR IT0)))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using the :definition INSERT, to Subgoal *1.1.1.1/3.1' (IMPLIES (AND (CONSP IT0) (NOT (LEXORDER IT3 (CAR IT0))) (NOT (EQUAL (INSERT IT1 (CDR IT0)) (INSERT X1 (INSERT IT1 IT)))) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 (CAR IT0))) (EQUAL (CONS (CAR IT0) (INSERT IT1 (CDR IT0))) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (CONS (CAR IT0) (INSERT IT1 (INSERT IT3 (CDR IT0)))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). The destructor terms (CAR IT0) and (CDR IT0) can be eliminated by using CAR-CDR-ELIM to replace IT0 by (CONS IT2 IT4), (CAR IT0) by IT2 and (CDR IT0) by IT4. This produces the following goal. Subgoal *1.1.1.1/3.1'' (IMPLIES (AND (CONSP (CONS IT2 IT4)) (NOT (LEXORDER IT3 IT2)) (NOT (EQUAL (INSERT IT1 IT4) (INSERT X1 (INSERT IT1 IT)))) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (EQUAL (CONS IT2 (INSERT IT1 IT4)) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (CONS IT2 (INSERT IT1 (INSERT IT3 IT4))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using primitive type reasoning, to Subgoal *1.1.1.1/3.1''' (IMPLIES (AND (NOT (LEXORDER IT3 IT2)) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (EQUAL (CONS IT2 (INSERT IT1 IT4)) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (CONS IT2 (INSERT IT1 (INSERT IT3 IT4))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). Name the formula above *1.1.1.1.4. Subgoal *1.1.1.1/2 (IMPLIES (AND (NOT (ENDP IT0)) (LEXORDER IT3 (CAR IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (INSERT IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT IT3 IT0)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1/2' (IMPLIES (AND (CONSP IT0) (LEXORDER IT3 (CAR IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (INSERT IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT IT3 IT0)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using the :definition INSERT, primitive type reasoning, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER, to the following four conjectures. Subgoal *1.1.1.1/2.4 (IMPLIES (AND (CONSP IT0) (LEXORDER IT3 (CAR IT0)) (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 (CAR IT0)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3)) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using the :rewrite rule LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER, to Subgoal *1.1.1.1/2.4' (IMPLIES (AND (CONSP IT0) (LEXORDER IT3 (CAR IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3)) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). The destructor terms (CAR IT0) and (CDR IT0) can be eliminated by using CAR-CDR-ELIM to replace IT0 by (CONS IT2 IT4), (CAR IT0) by IT2 and (CDR IT0) by IT4. This produces the following goal. Subgoal *1.1.1.1/2.4'' (IMPLIES (AND (CONSP (CONS IT2 IT4)) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (EQUAL (LIST* IT1 IT2 IT4) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3)) (EQUAL (LIST* IT1 IT3 IT2 IT4) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using primitive type reasoning, to Subgoal *1.1.1.1/2.4''' (IMPLIES (AND (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (EQUAL (LIST* IT1 IT2 IT4) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3)) (EQUAL (LIST* IT1 IT3 IT2 IT4) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). Name the formula above *1.1.1.1.5. Subgoal *1.1.1.1/2.3 (IMPLIES (AND (CONSP IT0) (LEXORDER IT3 (CAR IT0)) (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 (CAR IT0)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (LIST* IT3 IT1 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rule LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER, to Subgoal *1.1.1.1/2.3' (IMPLIES (AND (CONSP IT0) (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 (CAR IT0)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (LIST* IT3 IT1 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). The destructor terms (CAR IT0) and (CDR IT0) can be eliminated by using CAR-CDR-ELIM to replace IT0 by (CONS IT2 IT4), (CAR IT0) by IT2 and (CDR IT0) by IT4. This produces the following goal. Subgoal *1.1.1.1/2.3'' (IMPLIES (AND (CONSP (CONS IT2 IT4)) (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 IT2) (EQUAL (LIST* IT1 IT2 IT4) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (LIST* IT3 IT1 IT2 IT4) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using primitive type reasoning, to Subgoal *1.1.1.1/2.3''' (IMPLIES (AND (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 IT2) (EQUAL (LIST* IT1 IT2 IT4) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (LIST* IT3 IT1 IT2 IT4) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). Name the formula above *1.1.1.1.6. Subgoal *1.1.1.1/2.2 (IMPLIES (AND (CONSP IT0) (LEXORDER IT3 (CAR IT0)) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 (CAR IT0))) (EQUAL (CONS (CAR IT0) (INSERT IT1 (CDR IT0))) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3)) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). But simplification reduces this to T, using the :rewrite rule LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1.1.1/2.1 (IMPLIES (AND (CONSP IT0) (LEXORDER IT3 (CAR IT0)) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 (CAR IT0))) (EQUAL (CONS (CAR IT0) (INSERT IT1 (CDR IT0))) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). The destructor terms (CAR IT0) and (CDR IT0) can be eliminated by using CAR-CDR-ELIM to replace IT0 by (CONS IT2 IT4), (CAR IT0) by IT2 and (CDR IT0) by IT4. This produces the following goal. Subgoal *1.1.1.1/2.1' (IMPLIES (AND (CONSP (CONS IT2 IT4)) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (EQUAL (CONS IT2 (INSERT IT1 IT4)) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using primitive type reasoning, to Subgoal *1.1.1.1/2.1'' (IMPLIES (AND (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (EQUAL (CONS IT2 (INSERT IT1 IT4)) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (LIST* IT3 IT2 (INSERT IT1 IT4)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). We now use the fourth hypothesis by substituting (INSERT X1 (INSERT IT1 IT)) for (CONS IT2 (INSERT IT1 IT4)) and throwing away the hypothesis. This produces Subgoal *1.1.1.1/2.1''' (IMPLIES (AND (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). Name the formula above *1.1.1.1.7. Subgoal *1.1.1.1/1 (IMPLIES (AND (ENDP IT0) (NOT (LEXORDER X1 IT3)) (EQUAL (INSERT IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT IT3 IT0)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1/1' (IMPLIES (AND (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (INSERT IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1))) (EQUAL (INSERT IT1 (INSERT IT3 IT0)) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using the :definition INSERT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to the following two conjectures. Subgoal *1.1.1.1/1.2 (IMPLIES (AND (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3)) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). Name the formula above *1.1.1.1.8. Subgoal *1.1.1.1/1.1 (IMPLIES (AND (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (LIST* IT3 IT1 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). Name the formula above *1.1.1.1.9. Perhaps we can prove *1.1.1.1.9 by induction. Two induction schemes are suggested by this conjecture. These merge into one derived induction scheme. We will induct according to a scheme suggested by (INSERT IT3 IT), but modified to accommodate (INSERT IT1 IT). These suggestions were produced using the :induction rule INSERT. If we let (:P IT IT0 IT1 IT3 X1) denote *1.1.1.1.9 above then the induction scheme we'll use is (AND (IMPLIES (AND (NOT (ENDP IT)) (NOT (LEXORDER IT3 (CAR IT))) (:P (CDR IT) IT0 IT1 IT3 X1)) (:P IT IT0 IT1 IT3 X1)) (IMPLIES (AND (NOT (ENDP IT)) (LEXORDER IT3 (CAR IT))) (:P IT IT0 IT1 IT3 X1)) (IMPLIES (ENDP IT) (:P IT IT0 IT1 IT3 X1))). This induction is justified by the same argument used to admit INSERT. When applied to the goal at hand the above induction scheme produces four nontautological subgoals. Subgoal *1.1.1.1.9/4 (IMPLIES (AND (NOT (ENDP IT)) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (LIST* IT3 IT1 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (LIST* IT3 IT1 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1.9/4' (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (LIST* IT3 IT1 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (LIST* IT3 IT1 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using the :definition INSERT, primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER, to the following two conjectures. Subgoal *1.1.1.1.9/4.2 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (LIST* IT3 IT1 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 (CAR IT))) (EQUAL (CONS IT1 IT0) (INSERT X1 (CONS (CAR IT) (INSERT IT1 (CDR IT))))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (LEXORDER X1 (CAR IT))) (EQUAL (LIST* IT3 IT1 IT0) (LIST* X1 (CAR IT) (INSERT IT1 (INSERT IT3 (CDR IT)))))). But simplification reduces this to T, using primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rule LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1.1.1.9/4.1 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (LIST* IT3 IT1 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 (CAR IT))) (EQUAL (CONS IT1 IT0) (INSERT X1 (CONS (CAR IT) (INSERT IT1 (CDR IT))))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER X1 (CAR IT)))) (EQUAL (LIST* IT3 IT1 IT0) (LIST* (CAR IT) IT3 IT1 IT0))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription rule INSERT. Subgoal *1.1.1.1.9/3 (IMPLIES (AND (NOT (ENDP IT)) (NOT (LEXORDER IT3 (CAR IT))) (NOT (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (LIST* IT3 IT1 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1.9/3' (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (NOT (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (LIST* IT3 IT1 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using the :definition INSERT, primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER, to the following two conjectures. Subgoal *1.1.1.1.9/3.2 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (NOT (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 (CAR IT))) (EQUAL (CONS IT1 IT0) (INSERT X1 (CONS (CAR IT) (INSERT IT1 (CDR IT))))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (LEXORDER X1 (CAR IT))) (EQUAL (LIST* IT3 IT1 IT0) (LIST* X1 (CAR IT) (INSERT IT1 (INSERT IT3 (CDR IT)))))). But simplification reduces this to T, using primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rule LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1.1.1.9/3.1 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (NOT (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 (CAR IT))) (EQUAL (CONS IT1 IT0) (INSERT X1 (CONS (CAR IT) (INSERT IT1 (CDR IT))))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER X1 (CAR IT)))) (EQUAL (LIST* IT3 IT1 IT0) (CONS (CAR IT) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription rule INSERT. Subgoal *1.1.1.1.9/2 (IMPLIES (AND (NOT (ENDP IT)) (LEXORDER IT3 (CAR IT)) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (LIST* IT3 IT1 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1.9/2' (IMPLIES (AND (CONSP IT) (LEXORDER IT3 (CAR IT)) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (LIST* IT3 IT1 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using the :definition INSERT, primitive type reasoning, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER, to Subgoal *1.1.1.1.9/2'' (IMPLIES (AND (CONSP IT) (LEXORDER IT3 (CAR IT)) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 (CAR IT))) (EQUAL (CONS IT1 IT0) (INSERT X1 (CONS (CAR IT) (INSERT IT1 (CDR IT))))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (LIST* IT3 IT1 IT0) (INSERT X1 (INSERT IT1 (CONS IT3 IT))))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1.1.1.9/1 (IMPLIES (AND (ENDP IT) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (LIST* IT3 IT1 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1.9/1' (IMPLIES (AND (NOT (CONSP IT)) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (LIST* IT3 IT1 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS. That completes the proof of *1.1.1.1.9. We therefore turn our attention to *1.1.1.1.8, which is (IMPLIES (AND (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3)) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). Perhaps we can prove *1.1.1.1.8 by induction. Two induction schemes are suggested by this conjecture. These merge into one derived induction scheme. We will induct according to a scheme suggested by (INSERT IT3 IT), but modified to accommodate (INSERT IT1 IT). These suggestions were produced using the :induction rule INSERT. If we let (:P IT IT0 IT1 IT3 X1) denote *1.1.1.1.8 above then the induction scheme we'll use is (AND (IMPLIES (AND (NOT (ENDP IT)) (NOT (LEXORDER IT3 (CAR IT))) (:P (CDR IT) IT0 IT1 IT3 X1)) (:P IT IT0 IT1 IT3 X1)) (IMPLIES (AND (NOT (ENDP IT)) (LEXORDER IT3 (CAR IT))) (:P IT IT0 IT1 IT3 X1)) (IMPLIES (ENDP IT) (:P IT IT0 IT1 IT3 X1))). This induction is justified by the same argument used to admit INSERT. When applied to the goal at hand the above induction scheme produces four nontautological subgoals. Subgoal *1.1.1.1.8/4 (IMPLIES (AND (NOT (ENDP IT)) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3)) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1.8/4' (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3)) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using the :definition INSERT, primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS, CONS-EQUAL, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER, to the following four conjectures. Subgoal *1.1.1.1.8/4.4 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 (CAR IT)) (EQUAL (CONS IT1 IT0) (INSERT X1 (CONS IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER X1 (CAR IT))) (EQUAL (CONS IT3 IT0) (LIST* X1 (CAR IT) (INSERT IT3 (CDR IT))))). But simplification reduces this to T, using primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rule LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1.1.1.8/4.3 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 (CAR IT)) (EQUAL (CONS IT1 IT0) (INSERT X1 (CONS IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER X1 (CAR IT)))) (EQUAL (CONS IT3 IT0) (CONS (CAR IT) (INSERT X1 (INSERT IT3 (CDR IT)))))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS. Subgoal *1.1.1.1.8/4.2 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 (CAR IT))) (EQUAL (CONS IT1 IT0) (INSERT X1 (CONS (CAR IT) (INSERT IT1 (CDR IT))))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3) (LEXORDER X1 (CAR IT))) (EQUAL (LIST* IT1 IT3 IT0) (LIST* X1 (CAR IT) (INSERT IT1 (INSERT IT3 (CDR IT)))))). But simplification reduces this to T, using primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rule LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1.1.1.8/4.1 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 (CAR IT))) (EQUAL (CONS IT1 IT0) (INSERT X1 (CONS (CAR IT) (INSERT IT1 (CDR IT))))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3) (NOT (LEXORDER X1 (CAR IT)))) (EQUAL (LIST* IT1 IT3 IT0) (LIST* (CAR IT) IT1 IT3 IT0))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription rule INSERT. Subgoal *1.1.1.1.8/3 (IMPLIES (AND (NOT (ENDP IT)) (NOT (LEXORDER IT3 (CAR IT))) (NOT (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3)) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1.8/3' (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (NOT (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3)) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using the :definition INSERT, primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS, CONS-EQUAL, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER, to the following four conjectures. Subgoal *1.1.1.1.8/3.4 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (NOT (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 (CAR IT)) (EQUAL (CONS IT1 IT0) (INSERT X1 (CONS IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER X1 (CAR IT))) (EQUAL (CONS IT3 IT0) (LIST* X1 (CAR IT) (INSERT IT3 (CDR IT))))). But simplification reduces this to T, using primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rule LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1.1.1.8/3.3 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (NOT (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (LEXORDER IT1 (CAR IT)) (EQUAL (CONS IT1 IT0) (INSERT X1 (CONS IT1 IT))) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER X1 (CAR IT)))) (EQUAL (CONS IT3 IT0) (CONS (CAR IT) (INSERT X1 (INSERT IT3 (CDR IT)))))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS. Subgoal *1.1.1.1.8/3.2 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (NOT (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 (CAR IT))) (EQUAL (CONS IT1 IT0) (INSERT X1 (CONS (CAR IT) (INSERT IT1 (CDR IT))))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3) (LEXORDER X1 (CAR IT))) (EQUAL (LIST* IT1 IT3 IT0) (LIST* X1 (CAR IT) (INSERT IT1 (INSERT IT3 (CDR IT)))))). But simplification reduces this to T, using primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rule LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1.1.1.8/3.1 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (NOT (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 (CDR IT))))) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 (CAR IT))) (EQUAL (CONS IT1 IT0) (INSERT X1 (CONS (CAR IT) (INSERT IT1 (CDR IT))))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3) (NOT (LEXORDER X1 (CAR IT)))) (EQUAL (LIST* IT1 IT3 IT0) (CONS (CAR IT) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription rule INSERT. Subgoal *1.1.1.1.8/2 (IMPLIES (AND (NOT (ENDP IT)) (LEXORDER IT3 (CAR IT)) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3)) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1.8/2' (IMPLIES (AND (CONSP IT) (LEXORDER IT3 (CAR IT)) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3)) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning, the :rewrite rules CAR-CONS, CDR-CONS and LEXORDER-TRANSITIVE and the :type-prescription rules INSERT and LEXORDER. Subgoal *1.1.1.1.8/1 (IMPLIES (AND (ENDP IT) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3)) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1.8/1' (IMPLIES (AND (NOT (CONSP IT)) (NOT (CONSP IT0)) (NOT (LEXORDER X1 IT3)) (EQUAL (CONS IT1 IT0) (INSERT X1 (INSERT IT1 IT))) (NOT (LEXORDER X1 IT1)) (LEXORDER IT1 IT3)) (EQUAL (LIST* IT1 IT3 IT0) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS. That completes the proof of *1.1.1.1.8. We therefore turn our attention to *1.1.1.1.7, which is (IMPLIES (AND (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). Perhaps we can prove *1.1.1.1.7 by induction. Two induction schemes are suggested by this conjecture. These merge into one derived induction scheme. We will induct according to a scheme suggested by (INSERT IT3 IT), but modified to accommodate (INSERT IT1 IT). These suggestions were produced using the :induction rule INSERT. If we let (:P IT IT1 IT2 IT3 X1) denote *1.1.1.1.7 above then the induction scheme we'll use is (AND (IMPLIES (AND (NOT (ENDP IT)) (NOT (LEXORDER IT3 (CAR IT))) (:P (CDR IT) IT1 IT2 IT3 X1)) (:P IT IT1 IT2 IT3 X1)) (IMPLIES (AND (NOT (ENDP IT)) (LEXORDER IT3 (CAR IT))) (:P IT IT1 IT2 IT3 X1)) (IMPLIES (ENDP IT) (:P IT IT1 IT2 IT3 X1))). This induction is justified by the same argument used to admit INSERT. When applied to the goal at hand the above induction scheme produces three nontautological subgoals. Subgoal *1.1.1.1.7/3 (IMPLIES (AND (NOT (ENDP IT)) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 (CDR IT)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1.7/3' (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 (CDR IT)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using the :definition INSERT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to the following two conjectures. Subgoal *1.1.1.1.7/3.2 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 (CDR IT)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (LEXORDER IT1 (CAR IT))) (EQUAL (CONS IT3 (INSERT X1 (CONS IT1 IT))) (INSERT X1 (LIST* IT1 (CAR IT) (INSERT IT3 (CDR IT)))))). But simplification reduces this to T, using primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rule LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1.1.1.7/3.1 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 (CDR IT)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 (CAR IT)))) (EQUAL (CONS IT3 (INSERT X1 (CONS (CAR IT) (INSERT IT1 (CDR IT))))) (INSERT X1 (CONS (CAR IT) (INSERT IT1 (INSERT IT3 (CDR IT))))))). This simplifies, using the :definition INSERT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to the following two conjectures. Subgoal *1.1.1.1.7/3.1.2 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 (CDR IT)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 (CAR IT))) (LEXORDER X1 (CAR IT))) (EQUAL (LIST* IT3 X1 (CAR IT) (INSERT IT1 (CDR IT))) (LIST* X1 (CAR IT) (INSERT IT1 (INSERT IT3 (CDR IT)))))). But simplification reduces this to T, using primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rule LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1.1.1.7/3.1.1 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 (CDR IT)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 (CAR IT))) (NOT (LEXORDER X1 (CAR IT)))) (EQUAL (LIST* IT3 (CAR IT) (INSERT X1 (INSERT IT1 (CDR IT)))) (LIST* (CAR IT) IT3 (INSERT X1 (INSERT IT1 (CDR IT)))))). This simplifies, using primitive type reasoning and the :rewrite rules CAR-CONS, CDR-CONS and CONS-EQUAL, to Subgoal *1.1.1.1.7/3.1.1' (IMPLIES (AND (CONSP IT) (NOT (LEXORDER IT3 (CAR IT))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 (CDR IT)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT))))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 (CAR IT))) (NOT (LEXORDER X1 (CAR IT)))) (EQUAL IT3 (CAR IT))). The destructor terms (CAR IT) and (CDR IT) can be eliminated by using CAR-CDR-ELIM to replace IT by (CONS IT4 IT5), (CAR IT) by IT4 and (CDR IT) by IT5. This produces the following goal. Subgoal *1.1.1.1.7/3.1.1'' (IMPLIES (AND (CONSP (CONS IT4 IT5)) (NOT (LEXORDER IT3 IT4)) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT5))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT5)))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). This simplifies, using primitive type reasoning, to Subgoal *1.1.1.1.7/3.1.1''' (IMPLIES (AND (NOT (LEXORDER IT3 IT4)) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT5))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT5)))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). Name the formula above *1.1.1.1.7.1. Subgoal *1.1.1.1.7/2 (IMPLIES (AND (NOT (ENDP IT)) (LEXORDER IT3 (CAR IT)) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1.7/2' (IMPLIES (AND (CONSP IT) (LEXORDER IT3 (CAR IT)) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). This simplifies, using the :definition INSERT, the :rewrite rules LEXORDER- REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER, to the following two conjectures. Subgoal *1.1.1.1.7/2.2 (IMPLIES (AND (CONSP IT) (LEXORDER IT3 (CAR IT)) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (LEXORDER IT1 (CAR IT))) (EQUAL (CONS IT3 (INSERT X1 (CONS IT1 IT))) (INSERT X1 (INSERT IT1 (CONS IT3 IT))))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER- TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1.1.1.1.7/2.1 (IMPLIES (AND (CONSP IT) (LEXORDER IT3 (CAR IT)) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 (CAR IT)))) (EQUAL (CONS IT3 (INSERT X1 (CONS (CAR IT) (INSERT IT1 (CDR IT))))) (INSERT X1 (INSERT IT1 (CONS IT3 IT))))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS. Subgoal *1.1.1.1.7/1 (IMPLIES (AND (ENDP IT) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1.7/1' (IMPLIES (AND (NOT (CONSP IT)) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3))) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT))))). But simplification reduces this to T, using the :definition INSERT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS. So we now return to *1.1.1.1.7.1, which is (IMPLIES (AND (NOT (LEXORDER IT3 IT4)) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT5))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT5)))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). Perhaps we can prove *1.1.1.1.7.1 by induction. Two induction schemes are suggested by this conjecture. These merge into one derived induction scheme. We will induct according to a scheme suggested by (INSERT IT3 IT5), but modified to accommodate (INSERT IT1 IT5). These suggestions were produced using the :induction rule INSERT. If we let (:P IT1 IT2 IT3 IT4 IT5 X1) denote *1.1.1.1.7.1 above then the induction scheme we'll use is (AND (IMPLIES (AND (NOT (ENDP IT5)) (NOT (LEXORDER IT3 (CAR IT5))) (:P IT1 IT2 IT3 IT4 (CDR IT5) X1)) (:P IT1 IT2 IT3 IT4 IT5 X1)) (IMPLIES (AND (NOT (ENDP IT5)) (LEXORDER IT3 (CAR IT5))) (:P IT1 IT2 IT3 IT4 IT5 X1)) (IMPLIES (ENDP IT5) (:P IT1 IT2 IT3 IT4 IT5 X1))). This induction is justified by the same argument used to admit INSERT. When applied to the goal at hand the above induction scheme produces three nontautological subgoals. Subgoal *1.1.1.1.7.1/3 (IMPLIES (AND (NOT (ENDP IT5)) (NOT (LEXORDER IT3 (CAR IT5))) (NOT (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 (CDR IT5)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT5)))))) (NOT (LEXORDER IT3 IT4)) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT5))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT5)))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1.7.1/3' (IMPLIES (AND (CONSP IT5) (NOT (LEXORDER IT3 (CAR IT5))) (NOT (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 (CDR IT5)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT5)))))) (NOT (LEXORDER IT3 IT4)) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT5))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT5)))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). This simplifies, using the :definition INSERT, primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER, to Subgoal *1.1.1.1.7.1/3'' (IMPLIES (AND (CONSP IT5) (NOT (LEXORDER IT3 (CAR IT5))) (NOT (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 (CDR IT5)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT5)))))) (NOT (LEXORDER IT3 IT4)) (NOT (LEXORDER IT1 (CAR IT5))) (EQUAL (CONS IT3 (INSERT X1 (CONS (CAR IT5) (INSERT IT1 (CDR IT5))))) (INSERT X1 (CONS (CAR IT5) (INSERT IT1 (INSERT IT3 (CDR IT5)))))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). This simplifies, using the :definition INSERT, primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER, to Subgoal *1.1.1.1.7.1/3''' (IMPLIES (AND (CONSP IT5) (NOT (LEXORDER IT3 (CAR IT5))) (NOT (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 (CDR IT5)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT5)))))) (NOT (LEXORDER IT3 IT4)) (NOT (LEXORDER IT1 (CAR IT5))) (NOT (LEXORDER X1 (CAR IT5))) (EQUAL (LIST* IT3 (CAR IT5) (INSERT X1 (INSERT IT1 (CDR IT5)))) (CONS (CAR IT5) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT5)))))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). By the simple :rewrite rule CONS-EQUAL we reduce the conjecture to Subgoal *1.1.1.1.7.1/3'4' (IMPLIES (AND (CONSP IT5) (NOT (LEXORDER IT3 (CAR IT5))) (NOT (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 (CDR IT5)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT5)))))) (NOT (LEXORDER IT3 IT4)) (NOT (LEXORDER IT1 (CAR IT5))) (NOT (LEXORDER X1 (CAR IT5))) (EQUAL IT3 (CAR IT5)) (EQUAL (CONS (CAR IT5) (INSERT X1 (INSERT IT1 (CDR IT5)))) (INSERT X1 (INSERT IT1 (INSERT IT3 (CDR IT5))))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). But simplification reduces this to T, using trivial observations. Subgoal *1.1.1.1.7.1/2 (IMPLIES (AND (NOT (ENDP IT5)) (LEXORDER IT3 (CAR IT5)) (NOT (LEXORDER IT3 IT4)) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT5))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT5)))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1.7.1/2' (IMPLIES (AND (CONSP IT5) (LEXORDER IT3 (CAR IT5)) (NOT (LEXORDER IT3 IT4)) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT5))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT5)))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). This simplifies, using the :definition INSERT, the :rewrite rules LEXORDER- REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER, to the following two conjectures. Subgoal *1.1.1.1.7.1/2.2 (IMPLIES (AND (CONSP IT5) (LEXORDER IT3 (CAR IT5)) (NOT (LEXORDER IT3 IT4)) (LEXORDER IT1 (CAR IT5)) (EQUAL (CONS IT3 (INSERT X1 (CONS IT1 IT5))) (INSERT X1 (INSERT IT1 (CONS IT3 IT5)))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). This simplifies, using the :definition INSERT, primitive type reasoning, the :forward-chaining rule LEXORDER-TOTAL, the :rewrite rules CAR-CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type- prescription rule LEXORDER, to Subgoal *1.1.1.1.7.1/2.2' (IMPLIES (AND (CONSP IT5) (NOT (LEXORDER IT3 IT4)) (LEXORDER IT1 (CAR IT5)) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). The destructor terms (CAR IT5) and (CDR IT5) can be eliminated by using CAR-CDR-ELIM to replace IT5 by (CONS IT6 IT7), (CAR IT5) by IT6 and (CDR IT5) by IT7. This produces the following goal. Subgoal *1.1.1.1.7.1/2.2'' (IMPLIES (AND (CONSP (CONS IT6 IT7)) (NOT (LEXORDER IT3 IT4)) (LEXORDER IT1 IT6) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). This simplifies, using primitive type reasoning, to Subgoal *1.1.1.1.7.1/2.2''' (IMPLIES (AND (NOT (LEXORDER IT3 IT4)) (LEXORDER IT1 IT6) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). Name the formula above *1.1.1.1.7.1.1. Subgoal *1.1.1.1.7.1/2.1 (IMPLIES (AND (CONSP IT5) (LEXORDER IT3 (CAR IT5)) (NOT (LEXORDER IT3 IT4)) (NOT (LEXORDER IT1 (CAR IT5))) (EQUAL (CONS IT3 (INSERT X1 (CONS (CAR IT5) (INSERT IT1 (CDR IT5))))) (INSERT X1 (INSERT IT1 (CONS IT3 IT5)))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). This simplifies, using the :definition INSERT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to Subgoal *1.1.1.1.7.1/2.1' (IMPLIES (AND (CONSP IT5) (LEXORDER IT3 (CAR IT5)) (NOT (LEXORDER IT3 IT4)) (NOT (LEXORDER IT1 (CAR IT5))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). The destructor terms (CAR IT5) and (CDR IT5) can be eliminated by using CAR-CDR-ELIM to replace IT5 by (CONS IT6 IT7), (CAR IT5) by IT6 and (CDR IT5) by IT7. This produces the following goal. Subgoal *1.1.1.1.7.1/2.1'' (IMPLIES (AND (CONSP (CONS IT6 IT7)) (LEXORDER IT3 IT6) (NOT (LEXORDER IT3 IT4)) (NOT (LEXORDER IT1 IT6)) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). This simplifies, using primitive type reasoning, to Subgoal *1.1.1.1.7.1/2.1''' (IMPLIES (AND (LEXORDER IT3 IT6) (NOT (LEXORDER IT3 IT4)) (NOT (LEXORDER IT1 IT6)) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). Name the formula above *1.1.1.1.7.1.2. Subgoal *1.1.1.1.7.1/1 (IMPLIES (AND (ENDP IT5) (NOT (LEXORDER IT3 IT4)) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT5))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT5)))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1.1.1.7.1/1' (IMPLIES (AND (NOT (CONSP IT5)) (NOT (LEXORDER IT3 IT4)) (EQUAL (CONS IT3 (INSERT X1 (INSERT IT1 IT5))) (INSERT X1 (INSERT IT1 (INSERT IT3 IT5)))) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). This simplifies, using the :definition INSERT, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS, to Subgoal *1.1.1.1.7.1/1'' (IMPLIES (AND (NOT (CONSP IT5)) (NOT (LEXORDER IT3 IT4)) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). We suspect that the term (NOT (CONSP IT5)) is irrelevant to the truth of this conjecture and throw it out. We will thus try to prove Subgoal *1.1.1.1.7.1/1''' (IMPLIES (AND (NOT (LEXORDER IT3 IT4)) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). Name the formula above *1.1.1.1.7.1.3. But the formula above is subsumed by *1.1.1.1.7.1.2, which we'll try to prove later. We therefore regard *1.1.1.1.7.1.3 as proved (pending the proof of the more general *1.1.1.1.7.1.2). We next consider *1.1.1.1.7.1.2, which is (IMPLIES (AND (LEXORDER IT3 IT6) (NOT (LEXORDER IT3 IT4)) (NOT (LEXORDER IT1 IT6)) (LEXORDER IT3 IT2) (NOT (LEXORDER X1 IT3)) (NOT (LEXORDER IT1 IT2)) (NOT (LEXORDER X1 IT1)) (NOT (LEXORDER IT1 IT3)) (NOT (LEXORDER IT1 IT4)) (NOT (LEXORDER X1 IT4))) (EQUAL IT3 IT4)). No induction schemes are suggested by *1.1.1.1.7.1.2. Consequently, the proof attempt has failed. Summary Form: ( DEFTHM ISORT-ISORT ...) Rules: ((:DEFINITION ENDP) (:DEFINITION INSERT) (:DEFINITION ISORT) (:DEFINITION NOT) (:ELIM CAR-CDR-ELIM) (:FAKE-RUNE-FOR-TYPE-SET NIL) (:FORWARD-CHAINING LEXORDER-TOTAL) (:INDUCTION INSERT) (:INDUCTION ISORT) (:REWRITE CAR-CONS) (:REWRITE CDR-CONS) (:REWRITE CONS-EQUAL) (:REWRITE LEXORDER-REFLEXIVE) (:REWRITE LEXORDER-TRANSITIVE) (:TYPE-PRESCRIPTION INSERT) (:TYPE-PRESCRIPTION LEXORDER)) Warnings: None Time: 0.32 seconds (prove: 0.24, print: 0.08, other: 0.00) --- The key checkpoint goals, below, may help you to debug this failure. See :DOC failure and see :DOC set-checkpoint-summary-limit. --- *** Key checkpoint at the top level: *** Goal (EQUAL (ISORT (ISORT X)) (ISORT X)) *** Key checkpoint under a top-level induction: *** Subgoal *1/2'' (IMPLIES (AND (CONSP X) (EQUAL (ISORT (ISORT (CDR X))) (ISORT (CDR X)))) (EQUAL (ISORT (INSERT (CAR X) (ISORT (CDR X)))) (INSERT (CAR X) (ISORT (CDR X))))) ******** FAILED ******** See :DOC failure ******** FAILED ******** ACL2 >(pe 'orderedp-isort) 6:x(DEFTHM ORDEREDP-ISORT (ORDEREDP (ISORT X))) ACL2 >(defthm key-lemma (implies (orderedp a) (equal (isort a) a))) Name the formula above *1. Perhaps we can prove *1 by induction. Two induction schemes are suggested by this conjecture. Subsumption reduces that number to one. We will induct according to a scheme suggested by (ORDEREDP A). This suggestion was produced using the :induction rules ISORT and ORDEREDP. If we let (:P A) denote *1 above then the induction scheme we'll use is (AND (IMPLIES (AND (NOT (ENDP A)) (NOT (ENDP (CDR A))) (NOT (LEXORDER (CAR A) (CADR A)))) (:P A)) (IMPLIES (AND (NOT (ENDP A)) (NOT (ENDP (CDR A))) (LEXORDER (CAR A) (CADR A)) (:P (CDR A))) (:P A)) (IMPLIES (AND (NOT (ENDP A)) (ENDP (CDR A))) (:P A)) (IMPLIES (ENDP A) (:P A))). This induction is justified by the same argument used to admit ORDEREDP. When applied to the goal at hand the above induction scheme produces five nontautological subgoals. Subgoal *1/5 (IMPLIES (AND (NOT (ENDP A)) (NOT (ENDP (CDR A))) (NOT (LEXORDER (CAR A) (CADR A))) (ORDEREDP A)) (EQUAL (ISORT A) A)). By the simple :definition ENDP we reduce the conjecture to Subgoal *1/5' (IMPLIES (AND (CONSP A) (CONSP (CDR A)) (NOT (LEXORDER (CAR A) (CADR A))) (ORDEREDP A)) (EQUAL (ISORT A) A)). But simplification reduces this to T, using the :definition ORDEREDP. Subgoal *1/4 (IMPLIES (AND (NOT (ENDP A)) (NOT (ENDP (CDR A))) (LEXORDER (CAR A) (CADR A)) (EQUAL (ISORT (CDR A)) (CDR A)) (ORDEREDP A)) (EQUAL (ISORT A) A)). By the simple :definition ENDP we reduce the conjecture to Subgoal *1/4' (IMPLIES (AND (CONSP A) (CONSP (CDR A)) (LEXORDER (CAR A) (CADR A)) (EQUAL (ISORT (CDR A)) (CDR A)) (ORDEREDP A)) (EQUAL (ISORT A) A)). But simplification reduces this to T, using the :definitions INSERT, ISORT and ORDEREDP, primitive type reasoning, the :rewrite rules CONS- CAR-CDR, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type- prescription rule LEXORDER. Subgoal *1/3 (IMPLIES (AND (NOT (ENDP A)) (NOT (ENDP (CDR A))) (LEXORDER (CAR A) (CADR A)) (NOT (ORDEREDP (CDR A))) (ORDEREDP A)) (EQUAL (ISORT A) A)). By the simple :definition ENDP we reduce the conjecture to Subgoal *1/3' (IMPLIES (AND (CONSP A) (CONSP (CDR A)) (LEXORDER (CAR A) (CADR A)) (NOT (ORDEREDP (CDR A))) (ORDEREDP A)) (EQUAL (ISORT A) A)). But simplification reduces this to T, using the :definition ORDEREDP, the :rewrite rules LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rule LEXORDER. Subgoal *1/2 (IMPLIES (AND (NOT (ENDP A)) (ENDP (CDR A)) (ORDEREDP A)) (EQUAL (ISORT A) A)). By the simple :definition ENDP we reduce the conjecture to Subgoal *1/2' (IMPLIES (AND (CONSP A) (NOT (CONSP (CDR A))) (ORDEREDP A)) (EQUAL (ISORT A) A)). This simplifies, using the :definitions ISORT and ORDEREDP, to Subgoal *1/2'' (IMPLIES (AND (CONSP A) (NOT (CONSP (CDR A)))) (EQUAL (INSERT (CAR A) (ISORT (CDR A))) A)). But simplification reduces this to T, using the :definitions INSERT and ISORT, primitive type reasoning and the :rewrite rule CONS-CAR- CDR. Subgoal *1/1 (IMPLIES (AND (ENDP A) (ORDEREDP A)) (EQUAL (ISORT A) A)). By the simple :definition ENDP we reduce the conjecture to Subgoal *1/1' (IMPLIES (AND (NOT (CONSP A)) (ORDEREDP A)) (EQUAL (ISORT A) A)). But simplification reduces this to T, using the :definitions ISORT and ORDEREDP and primitive type reasoning. That completes the proof of *1. Q.E.D. Summary Form: ( DEFTHM KEY-LEMMA ...) Rules: ((:DEFINITION ENDP) (:DEFINITION INSERT) (:DEFINITION ISORT) (:DEFINITION NOT) (:DEFINITION ORDEREDP) (:FAKE-RUNE-FOR-TYPE-SET NIL) (:INDUCTION ISORT) (:INDUCTION ORDEREDP) (:REWRITE CONS-CAR-CDR) (:REWRITE LEXORDER-REFLEXIVE) (:REWRITE LEXORDER-TRANSITIVE) (:TYPE-PRESCRIPTION LEXORDER)) Warnings: None Time: 0.01 seconds (prove: 0.01, print: 0.00, other: 0.00) KEY-LEMMA ACL2 >(defthm isort-isort (equal (isort (isort x)) (isort x))) But simplification reduces this to T, using primitive type reasoning and the :rewrite rules KEY-LEMMA and ORDEREDP-ISORT. Q.E.D. Summary Form: ( DEFTHM ISORT-ISORT ...) Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL) (:REWRITE KEY-LEMMA) (:REWRITE ORDEREDP-ISORT)) Warnings: None Time: 0.00 seconds (prove: 0.00, print: 0.00, other: 0.00) ISORT-ISORT ACL2 >(include-book "perm") Summary Form: ( INCLUDE-BOOK "perm" ...) Rules: NIL Warnings: None Time: 0.03 seconds (prove: 0.00, print: 0.00, other: 0.03) "/v/filer4b/v11q001/text/marktoberdorf-08/scripts/perm.lisp" ACL2 >(pe 'perm) 9:x(INCLUDE-BOOK "perm") \ [Included books, outermost to innermost: "/v/filer4b/v11q001/text/marktoberdorf-08/scripts/perm.lisp" ] \ >L (DEFUN PERM (X Y) (IF (CONSP X) (AND (MEMBER (CAR X) Y) (PERM (CDR X) (RM (CAR X) Y))) (NOT (CONSP Y)))) ACL2 >(perm '(1 2 3) '(3 1 2)) T ACL2 >(perm '(1 2 3) '(1 3 4)) NIL ACL2 >(defthm perm-isort (perm (isort x) x)) ACL2 Warning [Double-rewrite] in ( DEFTHM PERM-ISORT ...): In a :REWRITE rule generated from PERM-ISORT, equivalence relation PERM is maintained at one problematic occurrence of variable X in the right-hand side, but not at any binding occurrence of X. Consider replacing that occurrence of X in the right-hand side with (DOUBLE-REWRITE X). See :doc double- rewrite for more information on this issue. Name the formula above *1. Perhaps we can prove *1 by induction. One induction scheme is suggested by this conjecture. We will induct according to a scheme suggested by (ISORT X). This suggestion was produced using the :induction rule ISORT. If we let (:P X) denote *1 above then the induction scheme we'll use is (AND (IMPLIES (AND (NOT (ENDP X)) (:P (CDR X))) (:P X)) (IMPLIES (ENDP X) (:P X))). This induction is justified by the same argument used to admit ISORT. When applied to the goal at hand the above induction scheme produces two nontautological subgoals. Subgoal *1/2 (IMPLIES (AND (NOT (ENDP X)) (PERM (ISORT (CDR X)) (CDR X))) (PERM (ISORT X) X)). By the simple :definition ENDP we reduce the conjecture to Subgoal *1/2' (IMPLIES (AND (CONSP X) (PERM (ISORT (CDR X)) (CDR X))) (PERM (ISORT X) X)). This simplifies, using the :definition ISORT, to Subgoal *1/2'' (IMPLIES (AND (CONSP X) (PERM (ISORT (CDR X)) (CDR X))) (PERM (INSERT (CAR X) (ISORT (CDR X))) X)). The destructor terms (CAR X) and (CDR X) can be eliminated by using CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X) by X1 and (CDR X) by X2. This produces the following goal. Subgoal *1/2''' (IMPLIES (AND (CONSP (CONS X1 X2)) (PERM (ISORT X2) X2)) (PERM (INSERT X1 (ISORT X2)) (CONS X1 X2))). This simplifies, using primitive type reasoning, to Subgoal *1/2'4' (IMPLIES (PERM (ISORT X2) X2) (PERM (INSERT X1 (ISORT X2)) (CONS X1 X2))). We generalize this conjecture, replacing (ISORT X2) by IT. This produces Subgoal *1/2'5' (IMPLIES (PERM IT X2) (PERM (INSERT X1 IT) (CONS X1 X2))). Name the formula above *1.1. Subgoal *1/1 (IMPLIES (ENDP X) (PERM (ISORT X) X)). By the simple :definition ENDP we reduce the conjecture to Subgoal *1/1' (IMPLIES (NOT (CONSP X)) (PERM (ISORT X) X)). But simplification reduces this to T, using the :definitions ORDEREDP and PERM and the :rewrite rule KEY-LEMMA. So we now return to *1.1, which is (IMPLIES (PERM IT X2) (PERM (INSERT X1 IT) (CONS X1 X2))). Perhaps we can prove *1.1 by induction. Two induction schemes are suggested by this conjecture. These merge into one derived induction scheme. We will induct according to a scheme suggested by (INSERT X1 IT), but modified to accommodate (PERM IT X2). These suggestions were produced using the :induction rules INSERT and PERM. If we let (:P IT X1 X2) denote *1.1 above then the induction scheme we'll use is (AND (IMPLIES (AND (NOT (ENDP IT)) (NOT (LEXORDER X1 (CAR IT))) (:P (CDR IT) X1 (RM (CAR IT) X2))) (:P IT X1 X2)) (IMPLIES (AND (NOT (ENDP IT)) (LEXORDER X1 (CAR IT))) (:P IT X1 X2)) (IMPLIES (ENDP IT) (:P IT X1 X2))). This induction is justified by the same argument used to admit INSERT. Note, however, that the unmeasured variable X2 is being instantiated. When applied to the goal at hand the above induction scheme produces four nontautological subgoals. Subgoal *1.1/4 (IMPLIES (AND (NOT (ENDP IT)) (NOT (LEXORDER X1 (CAR IT))) (PERM (INSERT X1 (CDR IT)) (CONS X1 (RM (CAR IT) X2))) (PERM IT X2)) (PERM (INSERT X1 IT) (CONS X1 X2))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1/4' (IMPLIES (AND (CONSP IT) (NOT (LEXORDER X1 (CAR IT))) (PERM (INSERT X1 (CDR IT)) (CONS X1 (RM (CAR IT) X2))) (PERM IT X2)) (PERM (INSERT X1 IT) (CONS X1 X2))). This simplifies, using the :definitions INSERT, MEMBER, PERM and RM, the :equivalence rule PERM-IS-AN-EQUIVALENCE, primitive type reasoning, the :rewrite rules CAR-CONS and CDR-CONS and the :type-prescription rule MEMBER, to the following two conjectures. Subgoal *1.1/4.2 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER X1 (CAR IT))) (PERM (INSERT X1 (CDR IT)) (CONS X1 (RM (CAR IT) X2))) (MEMBER (CAR IT) X2) (PERM (CDR IT) (RM (CAR IT) X2)) (EQUAL (CAR IT) X1)) (PERM (INSERT X1 (CDR IT)) X2)). But simplification reduces this to T, using primitive type reasoning and the :forward-chaining rule LEXORDER-TOTAL. Subgoal *1.1/4.1 (IMPLIES (AND (CONSP IT) (NOT (LEXORDER X1 (CAR IT))) (PERM (INSERT X1 (CDR IT)) (CONS X1 (RM (CAR IT) X2))) (MEMBER (CAR IT) X2) (PERM (CDR IT) (RM (CAR IT) X2)) (NOT (EQUAL (CAR IT) X1))) (PERM (INSERT X1 (CDR IT)) (INSERT X1 (CDR IT)))). But simplification reduces this to T, using primitive type reasoning. Subgoal *1.1/3 (IMPLIES (AND (NOT (ENDP IT)) (NOT (LEXORDER X1 (CAR IT))) (NOT (PERM (CDR IT) (RM (CAR IT) X2))) (PERM IT X2)) (PERM (INSERT X1 IT) (CONS X1 X2))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1/3' (IMPLIES (AND (CONSP IT) (NOT (LEXORDER X1 (CAR IT))) (NOT (PERM (CDR IT) (RM (CAR IT) X2))) (PERM IT X2)) (PERM (INSERT X1 IT) (CONS X1 X2))). But simplification reduces this to T, using the :definition PERM and primitive type reasoning. Subgoal *1.1/2 (IMPLIES (AND (NOT (ENDP IT)) (LEXORDER X1 (CAR IT)) (PERM IT X2)) (PERM (INSERT X1 IT) (CONS X1 X2))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1/2' (IMPLIES (AND (CONSP IT) (LEXORDER X1 (CAR IT)) (PERM IT X2)) (PERM (INSERT X1 IT) (CONS X1 X2))). But simplification reduces this to T, using the :definitions INSERT, MEMBER, PERM and RM, primitive type reasoning, the :rewrite rules CAR- CONS, CDR-CONS, LEXORDER-REFLEXIVE and LEXORDER-TRANSITIVE and the :type-prescription rules LEXORDER and MEMBER. Subgoal *1.1/1 (IMPLIES (AND (ENDP IT) (PERM IT X2)) (PERM (INSERT X1 IT) (CONS X1 X2))). By the simple :definition ENDP we reduce the conjecture to Subgoal *1.1/1' (IMPLIES (AND (NOT (CONSP IT)) (PERM IT X2)) (PERM (INSERT X1 IT) (CONS X1 X2))). But simplification reduces this to T, using the :definitions INSERT, MEMBER, PERM and RM, primitive type reasoning and the :rewrite rules CAR-CONS and CDR-CONS. That completes the proofs of *1.1 and *1. Q.E.D. Summary Form: ( DEFTHM PERM-ISORT ...) Rules: ((:DEFINITION ENDP) (:DEFINITION INSERT) (:DEFINITION ISORT) (:DEFINITION MEMBER) (:DEFINITION NOT) (:DEFINITION ORDEREDP) (:DEFINITION PERM) (:DEFINITION RM) (:ELIM CAR-CDR-ELIM) (:EQUIVALENCE PERM-IS-AN-EQUIVALENCE) (:FAKE-RUNE-FOR-TYPE-SET NIL) (:FORWARD-CHAINING LEXORDER-TOTAL) (:INDUCTION INSERT) (:INDUCTION ISORT) (:INDUCTION PERM) (:REWRITE CAR-CONS) (:REWRITE CDR-CONS) (:REWRITE KEY-LEMMA) (:REWRITE LEXORDER-REFLEXIVE) (:REWRITE LEXORDER-TRANSITIVE) (:TYPE-PRESCRIPTION LEXORDER) (:TYPE-PRESCRIPTION MEMBER)) Warnings: Double-rewrite Time: 0.02 seconds (prove: 0.01, print: 0.01, other: 0.00) PERM-ISORT ACL2 >(quote (end of demo 2)) (END OF DEMO 2) ACL2 >