The condensed detachment rule, or ruleD, was first proposed by Carew Meredith in the 1950's for propositional logic based on implication. It is a combination of modus ponens with a “minimal” amount of substitution. We shall give a precise detailed statement of rule D. (Some attempts in the published literature to do this have been inaccurate.)The D-completeness question for a given set of logical axioms is whether every formula deducible from the axioms by modus ponens and substitution can be deduced instead by rule D alone. Under the well-known formulae-as-types correspondence between propositional logic and combinator-based type-theory, rule D turns out to correspond exactly to an algorithm for computing principal type-schemes in combinatory logic. Using this fact, we shall show that D is complete for intuitionistic and classical implicational logic. We shall also show that D is incomplete for two weaker systems, BCK- and BCI-logic.In describing the formulae-as-types correspondence it is common to say that combinators correspond to proofs in implicational logic. But if “proofs” means “proofs by the usual rules of modus ponens and substitution”, then this is not true. It only becomes true when we say “proofs by rule D”; we shall describe the precise correspondence in Corollary 6.7.1 below.This paper is written for readers in propositional logic and in combinatory logic. Since workers in one field may not feel totally happy in the other, we include short introductions to both fields.We wish to record thanks to Martin Bunder, Adrian Rezus and the referee for helpful comments and advice.