Recent from talks
Nothing was collected or created yet.
Structural induction
View on WikipediaStructural induction is a proof method that is used in mathematical logic (e.g., in the proof of Łoś' theorem), computer science, graph theory, and some other mathematical fields. It is a generalization of mathematical induction over natural numbers and can be further generalized to arbitrary Noetherian induction. Structural recursion is a recursion method bearing the same relationship to structural induction as ordinary recursion bears to ordinary mathematical induction.
Structural induction is used to prove that some proposition P(x) holds for all x of some sort of recursively defined structure, such as formulas, lists, or trees. A well-founded partial order is defined on the structures ("subformula" for formulas, "sublist" for lists, and "subtree" for trees). The structural induction proof is a proof that the proposition holds for all the minimal structures and that if it holds for the immediate substructures of a certain structure S, then it must hold for S also. (Formally speaking, this then satisfies the premises of an axiom of well-founded induction, which asserts that these two conditions are sufficient for the proposition to hold for all x.)
A structurally recursive function uses the same idea to define a recursive function: "base cases" handle each minimal structure and a rule for recursion. Structural recursion is usually proved correct by structural induction; in particularly easy cases, the inductive step is often left out. The length and ++ functions in the example below are structurally recursive.
For example, if the structures are lists, one usually introduces the partial order "<", in which L < M whenever list L is the tail of list M. Under this ordering, the empty list [] is the unique minimal element. A structural induction proof of some proposition P(L) then consists of two parts: A proof that P([]) is true and a proof that if P(L) is true for some list L, and if L is the tail of list M, then P(M) must also be true.
Eventually, there may exist more than one base case and/or more than one inductive case, depending on how the function or structure was constructed. In those cases, a structural induction proof of some proposition P(L) then consists of:
- a proof that P(BC) is true for each base case BC,
- a proof that if P(I) is true for some instance I, and M can be obtained from I by applying any one recursive rule once, then P(M) must also be true.
Examples
[edit]
An ancestor tree is a commonly known data structure, showing the parents, grandparents, etc. of a person as far as known (see picture for an example). It is recursively defined:
- in the simplest case, an ancestor tree shows just one person (if nothing is known about their parents);
- alternatively, an ancestor tree shows one person and, connected by branches, the two ancestor subtrees of their parents (using for brevity of proof the simplifying assumption that if one of them is known, both are).
As an example, the property "An ancestor tree extending over g generations shows at most 2g − 1 persons" can be proven by structural induction as follows:
- In the simplest case, the tree shows just one person and hence one generation; the property is true for such a tree, since 1 ≤ 21 − 1.
- Alternatively, the tree shows one person and their parents' trees. Since each of the latter is a substructure of the whole tree, it can be assumed to satisfy the property to be proven (a.k.a. the induction hypothesis). That is, p ≤ 2g − 1 and q ≤ 2h − 1 can be assumed, where g and h denotes the number of generations the father's and the mother's subtree extends over, respectively, and p and q denote the numbers of persons they show.
- In case g ≤ h, the whole tree extends over 1 + h generations and shows p + q + 1 persons, andi.e. the whole tree satisfies the property.
- In case h ≤ g, the whole tree extends over 1 + g generations and shows p + q + 1 ≤ 2g + 1 − 1 persons by similar reasoning, i.e. the whole tree satisfies the property in this case also.
Hence, by structural induction, each ancestor tree satisfies the property.
As another, more formal example, consider the following property of lists :
Here ++ denotes the list concatenation operation, len() the list length, and L and M are lists.
In order to prove this, we need definitions for length and for the concatenation operation. Let (h:t) denote a list whose head (first element) is h and whose tail (list of remaining elements) is t, and let [] denote the empty list. The definitions for length and the concatenation operation are:
Our proposition P(l) is that EQ is true for all lists M when L is l. We want to show that P(l) is true for all lists l. We will prove this by structural induction on lists.
First we will prove that P([]) is true; that is, EQ is true for all lists M when L happens to be the empty list []. Consider EQ:
So this part of the theorem is proved; EQ is true for all M, when L is [], because the left-hand side and the right-hand side are equal.
Next, consider any nonempty list I. Since I is nonempty, it has a head item, x, and a tail list, xs, so we can express it as (x:xs). The induction hypothesis is that EQ is true for all values of M when L is xs:
We would like to show that if this is the case, then EQ is also true for all values of M when L = I = (x:xs). We proceed as before:
Thus, from structural induction, we obtain that P(L) is true for all lists L.
Well-ordering
[edit]Just as standard mathematical induction is equivalent to the well-ordering principle, structural induction is also equivalent to a well-ordering principle. If the set of all structures of a certain kind admits a well-founded partial order, then every nonempty subset must have a minimal element. (This is the definition of "well-founded".) The significance of the lemma in this context is that it allows us to deduce that if there are any counterexamples to the theorem we want to prove, then there must be a minimal counterexample. If we can show the existence of the minimal counterexample implies an even smaller counterexample, we have a contradiction (since the minimal counterexample isn't minimal) and so the set of counterexamples must be empty.
As an example of this type of argument, consider the set of all binary trees. We will show that the number of leaves in a full binary tree is one more than the number of interior nodes. Suppose there is a counterexample; then there must exist one with the minimal possible number of interior nodes. This counterexample, C, has n interior nodes and l leaves, where n + 1 ≠ l. Moreover, C must be nontrivial, because the trivial tree has n = 0 and l = 1 and is therefore not a counterexample. C therefore has at least one leaf whose parent node is an interior node. Delete this leaf and its parent from the tree, promoting the leaf's sibling node to the position formerly occupied by its parent. This reduces both n and l by 1, so the new tree also has n + 1 ≠ l and is therefore a smaller counterexample. But by hypothesis, C was already the smallest counterexample; therefore, the supposition that there were any counterexamples to begin with must have been false. The partial ordering implied by 'smaller' here is the one that says that S < T whenever S has fewer nodes than T.
See also
[edit]- Coinduction
- Initial algebra
- Loop invariant, analog for loops
References
[edit]- Hopcroft, John E.; Rajeev Motwani; Jeffrey D. Ullman (2001). Introduction to Automata Theory, Languages, and Computation (2nd ed.). Reading Mass: Addison-Wesley. ISBN 978-0-201-44124-6.
- "Mathematical Logic - Video 01.08 - Generalized (Structural) Induction" on YouTube
Early publications about structural induction include:
- Burstall, R. M. (1969). "Proving Properties of Programs by Structural Induction". The Computer Journal. 12 (1): 41–48. doi:10.1093/comjnl/12.1.41.
- Aubin, Raymond (1976), Mechanizing Structural Induction, EDI-INF-PHD, vol. 76–002, University of Edinburgh, hdl:1842/6649
- Huet, G.; Hullot, J. M. (1980). "Proofs by Induction in Equational Theories with Constructors" (PDF). 21st Ann. Symp. on Foundations of Computer Science. IEEE. pp. 96–107.
- Rózsa Péter, Über die Verallgemeinerung der Theorie der rekursiven Funktionen für abstrakte Mengen geeigneter Struktur als Definitionsbereiche, Symposium International, Varsovie septembre (1959) (On the generalization of the theory of recursive functions for abstract quantities with suitable structures as domains).
Structural induction
View on GrokipediaFundamentals
Definition and Motivation
Structural induction is a proof technique employed to establish that a given property holds for every element within a recursively defined set. The method proceeds in two main steps: first, verifying the property for the base cases, which consist of the atomic or minimal structures from which the set is constructed; second, demonstrating the inductive step, wherein if the property is assumed to hold for all immediate substructures of a given structure, it is then shown to hold for the entire structure formed by combining those substructures.[6] This approach ensures that the property propagates through the recursive construction of the set, covering all possible elements without omission.[6] The motivation for structural induction arises from the need to extend the scope of mathematical induction, which is highly effective for linearly ordered structures such as the natural numbers but inadequate for more complex, non-linear recursive structures that branch or nest, like those encountered in logic, computer science, and graph theory. While mathematical induction relies on a total order to step progressively from smaller to larger elements, structural induction leverages the hierarchical, bottom-up composition of recursive definitions, allowing properties to be verified by induction over the structure's decomposition into subparts. This generalization addresses the limitations of standard induction by providing a rigorous way to reason about properties that depend on the internal organization of the structure rather than just its size or position in a sequence.[6] Historically, the foundations of structural induction trace back to early 20th-century developments in mathematical logic, particularly the work of Alfred North Whitehead and Bertrand Russell in Principia Mathematica (1910–1913), where inductive definitions were used to construct natural numbers via the ancestral relation of the successor function, laying groundwork for proving properties over recursively defined hierarchies within their ramified type theory. The technique was later formalized and named in computer science by R.M. Burstall in 1969 for proving properties of programs and recursive data structures.[7][8] The key intuition underlying structural induction is that since these structures are assembled incrementally from simpler components, a property verified at the foundational level and preserved under the recursive construction rules will necessarily hold throughout the entire edifice, mirroring the bottom-up propagation seen in the logical systems of that era.[7]Prerequisites: Recursion and Well-Founded Sets
Recursive definitions form the foundation for constructing complex structures in mathematics and computer science by specifying sets as the smallest collections satisfying certain closure properties. A set is recursively defined by designating a base set of initial elements and a collection of operations (constructors) that generate new elements from existing ones. Formally, is the smallest set such that and for each constructor , if , then . This can be expressed as , where the union is over all constructors .[9][10] The existence and uniqueness of such a set follow from the fixpoint theorem for monotone operators in the power set lattice. Consider the operator , which is monotone (if , then ). The Knaster-Tarski fixpoint theorem guarantees that has a least fixpoint, given by the intersection of all sets such that ; this least fixpoint is precisely the recursively defined set . This construction ensures contains exactly the elements obtainable from via finite applications of the constructors, avoiding extraneous elements.[9] Well-founded sets provide the ordering necessary to ensure that recursive constructions terminate and avoid paradoxes like infinite regresses. A binary relation on a set is well-founded if there exists no infinite descending chain , where each is strictly less than under . Equivalently, every non-empty subset of has at least one -minimal element, meaning an element such that no satisfies with . This equivalence holds because the absence of descending chains implies the minimality property, and conversely, if a subset lacks a minimal element, one can construct an infinite descending chain by repeatedly selecting non-minimal elements.[11] The accessibility predicate formalizes the notion of elements reachable in finitely many steps within a well-founded structure, underpinning the termination of recursive processes. For a well-founded relation on with base elements , the accessibility predicate holds if or there exists such that and . Inductively, defines the subset of elements accessible from via finite ascending chains under the converse of , ensuring no cycles or infinite descents. This predicate is crucial for proving properties of recursively defined sets, as well-foundedness guarantees that every accessible element has a finite "construction depth."Formal Framework
General Principle of Structural Induction
Structural induction is a proof technique used to establish that a property holds for all elements of a recursively defined set , leveraging the inductive structure of itself. The set is typically defined by a collection of base elements and constructor functions that build new elements from existing ones in . To prove , one must verify two components: the base case, where holds for every base element ; and the inductive step, where for every constructor and arguments such that the substructures satisfy , it follows that holds.[12][13] In formal notation, consider a structure defined by constructors (for ), where each takes subterms as arguments to form new terms . The principle proceeds by induction on the height (or rank) of terms , defined as the maximum nesting depth of constructors in ; the base case covers terms of height 0 (base elements), and the inductive step assumes for all terms of strictly smaller height to prove it for terms of the current height. This ordering ensures no infinite descending chains, relying on the well-founded relation of subterms.[14][4] Structural induction typically employs a strong variant, where the inductive hypothesis assumes holds for all proper subterms of the current term, rather than merely the immediate ones (a weaker form that may suffice in simpler cases but is less general). The strong form is expressed in a schema resembling case analysis over constructors:- Base cases: For each base element , establish .
- Inductive cases: For each constructor applied to subterms , assume for all (and all proper subterms thereof, recursively); then prove .
