How to Facilitate the Proof of Theorems by Using the Induction-matching, and by Generalization

Jacqueline CastaingIJCAI 1985

Introduction

In the field of formal methods and automated reasoning, structural induction serves as a fundamental technique for verifying the correctness of programs that utilize recursive data structures, such as lists and trees. However, a persistent challenge in automated theorem proving is the "induction gap": the scenario where a standard induction hypothesis is too weak to prove the desired conclusion.

This paper, published in the mid-1980s by Jacqueline Castaing, introduces a systematic approach to bridging this gap. By utilizing a technique called "induction matching" (i-matching), the proposed system treats proof failures not as terminal errors, but as diagnostic maps that guide the machine toward necessary generalizations and lemma generation.

The Problem: The Induction Gap

When a computer attempts to prove a theorem via structural induction, it seeks to show that if a property holds for a structure $M$ (the hypothesis), it must also hold for a larger structure $N$ (the conclusion). In many practical cases—such as proving the correctness of a sorting algorithm or the equivalence of two functions—the conclusion $N$ is not a direct instance of the hypothesis $M$.

Human mathematicians typically solve this by "generalizing" the theorem. By proving a broader version of the statement, they often provide themselves with a stronger induction hypothesis that makes the proof easier to complete. Historically, automated systems like the Boyer-Moore prover relied on rigid heuristics to mimic this intuition. Castaing’s work sought to replace these heuristics with a more flexible, formal framework implemented in Lisp.

Methodology: i-Matching and Savage Generalization

The system proposed by Castaing operates through four primary strategies designed to automate the "aha!" moments of mathematical discovery.

1. Induction Matching (i-matching)

At the core of the system is i-matching. This process checks whether the conclusion $N$ can be transformed into the hypothesis $M$ through a specific substitution of variables. If a direct match is found, the proof is trivial. If the match fails, the system analyzes the specific subterms where the mismatch occurred. These failure points act as coordinates, pinpointing exactly which parts of the theorem require modification.

2. Savage Generalization

When i-matching identifies problematic subterms, the system performs a "savage generalization." This involves replacing the offending subterms with entirely new variables. While this often results in a statement that is too broad—and potentially false—it provides a starting point for the system to explore the logical space of the theorem.

3. Refinement via Call-by-Need

To correct the potential over-generalization of the savage step, the system employs a "call-by-need" evaluation. It identifies the "recursion positions" of the newly introduced variables. By analyzing how these variables interact within the function's recursive structure, the system searches for equality relations that can constrain the variables. This ensures the resulting theorem is general enough to be provable but specific enough to remain true.

4. Lemma Generation and Expansion

In cases where the mismatch is caused by differing function symbols (for example, an extra append operation on one side of an equation), the system utilizes a "procedure of expansion." It applies known algebraic properties, such as neutral elements (e.g., nil for list operations), to expand the hypothesis until the structures align. This effectively allows the machine to discover necessary lemmas about function interactions on the fly.

Evaluation and Key Results

The method was evaluated using classic benchmarks in functional programming, specifically focusing on list operations and recursion equivalence.

  • Associativity of append: The system successfully proved complex identities like (append x (append x x)) = (append (append x x) x). By identifying contradictory substitutions during the i-matching phase, the system was able to generalize variables and resolve the proof without manual intervention.
  • Tail-Recursion Equivalence: A significant achievement of the system was proving the equivalence between standard recursive functions and their tail-recursive counterparts (which use accumulators). The system used its expansion procedure to introduce neutral elements, recreating the logic a human uses when realizing an extra lemma is needed to handle the accumulator's state.

Discussion and Limitations

Castaing’s work demonstrated that mathematical intuition—specifically the ability to generalize from failure—could be systematized. By treating a failed match as a diagnostic tool, the system moved away from the "black box" heuristics of earlier provers toward a more transparent, coordinate-based approach to generalization.

However, the paper acknowledges several limitations. The search space for finding the exact conditions to make a savage generalization true can be vast, sometimes requiring the solution of complex Diophantine-type equations. Furthermore, the current implementation focuses primarily on equality relations; more advanced theorems might require the system to handle a broader range of logical relations. Despite these challenges, the research provided a foundational step in making automated provers more autonomous and capable of handling the "induction gap" that characterizes complex software verification.

Summary updated

BibTeX
@inproceedings{castaing1985how,
  author = {Jacqueline Castaing},
  title = {{How to Facilitate the Proof of Theorems by Using the Induction-matching, and by Generalization}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {1985},
}
Figure