Theorem Reuse by Proof Term Transformation Einar Broch Johnsen 1 and Christoph Lüth 2 1 Department of Informatics, University of Oslo, Norway einarj@ifi.uio.no 2 FB 3 – Mathematics and Computer Science, Universität Bremen, Germany cxl@informatik.uni-bremen.de Abstract. Proof reuse addresses the issue of how proofs of theorems in a specific setting can be used to prove other theorems in different settings. This paper proposes an approach where theorems are generalised by ab- stracting their proofs from the original setting. The approach is based on a representation of proofs as logical framework proof terms, using the theorem prover Isabelle. The logical framework allows type-specific in- ference rules to be handled uniformly in the abstraction process and the prover’s automated proof tactics may be used freely. This way, estab- lished results become more generally applicable; for example, theorems about a data type can be reapplied to other types. The paper also consid- ers how to reapply such abstracted theorems, and suggests an approach based on mappings between operations and types, and on systematically exploiting the dependencies between theorems. 1 Introduction Formal proof and development requires considerable effort, which can be re- duced through reuse of established results. Often, a new datatype or theory resembles a previously developed one and there is considerable gain if theorems can carry over from one type to another. Previous work in this area addresses reuse by proof or tactic modification in response to changes in the proof goal such as modifying the constructors of a datatype, or unfortunate variable in- stantiations during a proof search [6, 7, 14, 22, 26]. In contrast, type-theoretic approaches [12, 13, 20] investigate the generalisation and modification of proofs by transforming the associated proof terms in the context of constructive type theory. This paper proposes a method for abstracting previously established the- orems by proof transformations in a logical framework with proof terms. Logical frameworks are particularly well-suited for this approach, because inference rules are represented as formulae in the formalism; the choice of object logic becomes independent of the meta-logic in which the proof terms live. The method we propose has been implemented in Isabelle [16], using the proof terms recently added by Berghofer and Nipkow [4]. Isabelle offers a wide range of powerful tactics and libraries, and we can work in any of the logics encoded into Isabelle, such as classical higher-order logic (HOL), Zermelo-Fraenkel set theory (ZF), and various modal logics [17]. However, the approach should be applicable to any logical framework style theorem prover. K. Slind et al. (Eds.): TPHOLs 2004, LNCS 3223, pp. 152–167, 2004. c Springer-Verlag Berlin Heidelberg 2004