Algorithm termination 2026-10-18
Algorithm termination means that execution finishes after finitely many steps on the inputs under consideration. Specify that domain: the stalled loop in partial correctness terminates for but runs forever for . A successful run on one input does not establish termination on another.
A useful method is a loop variant that is a nonnegative integer at every condition check and strictly decreases whenever the condition is true and the body completes. Also prove that condition evaluation and each body execution terminate. An infinite run would then give an infinite strictly decreasing sequence of nonnegative integers, contradicting their well-founded relation. This establishes algorithm termination without enumerating all executions.
For the summation loop verification, begins at and decreases by exactly one per iteration. The body executes exactly times, including zero times for . Merely bounding a decreasing measure below is insufficient for real numbers: decreases forever while staying positive. The choice of a well-founded relation supplies the essential progress argument; well-founded progress in recursion applies the same idea to recursive calls.
Base case 2026-10-18
A case answered without further recursive calls. Complete base cases are one part of an algorithm termination argument; the other cases must progress in a well-founded relation.
Countable membership coding 2026-10-14
A countable well-founded relation that is an extensional relation codes a transitive set through the Mostowski collapse theorem. Adding a distinguished point selects one decoded set. Every hereditarily countable set has such a code by enumerating its transitive membership ancestry. There are only continuum many codes. In ZFC, selecting least codes in a well-order gives an injection of the hereditarily countable sets into a set of size .
Past exam of the mathematics course of the University of Cambridge 2006 ii Paper 4 16H Solution Created 2026-09-24 Updated 2026-10-14
A relation on a set is a well-founded relation when every nonempty subset contains an element with no satisfying . The well-founded recursion theorem states that a rule assigning a value at from the already assigned values at its predecessors determines a unique function on ; the rule must give a unique set-valued output for every possible predecessor assignment. No choice or transitivity of is needed.
Apply recursion withThe empty supremum is zero. Well-founded induction makes every value an ordinal; the Axiom schema of replacement collects the values into a set. Choose an ordinal larger than every value. Then , and implies , hence .
Conversely, suppose such an ordinal-valued function exists. In any nonempty , choose whose value is the least ordinal in . There can be no with , because it would have smaller value. Thus is well-founded, proving the equivalence.
Using the axiom of choice, fix a well-order of . Order its elements lexicographically by : first compare the ordinal rank, and for equal ranks use . Every nonempty subset has a smallest rank and then a least element in that rank fibre, so this is a well-order. Since strictly increases rank, it respects every original relation pair. Hence every well-founded relation extends to a well-order under choice.
Past exam of the mathematics course of the University of Cambridge 2007 ii Paper 4 16G Solution Created 2026-09-24 Updated 2026-10-14
A binary relation on a set is a well-founded relation if every nonempty subset has an -minimal member, that is, a member with no predecessor inside that subset. Here write when .
Suppose is well-founded and fix any . Call a partial function consistent if is downward closed under and for . Two consistent partial functions agree on their common domain: otherwise the set of points where they disagree has a minimal member, all of whose predecessors are in both domains and agree, so applying gives agreement at that member as well, a contradiction. Thus the union of all consistent partial functions is itself a function , on a downward-closed domain, and remains consistent. This union is a set, because every such graph is a subset of .
If , choose a minimal member of . All predecessors of lie in , so extend to by the prescribed value . The enlarged domain remains downward closed and consistent, contradicting the union's maximality. Hence . The same minimal-disagreement argument proves uniqueness. This establishes the required recursion directly, without invoking an unproved well-founded recursion theorem.
Conversely, if is not well-founded, choose a nonempty such that each has a predecessor in . Let be all points reachable from by a finite chain of upward steps, including . ThenFor a point reached by a nonempty chain, its preceding point is in ; for a point of , use its predecessor in . The converse follows by appending the final step to a chain. Choose and if , zero otherwise. Both and satisfy the required recursion, and they differ because . This contradicts recursiveness. Therefore is recursive exactly when its predecessor relation is well-founded, the characterization of a recursive powerset mapping.
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 83 2 Solution Created 2026-10-03 Updated 2026-10-14
We work in the ambient theory ZFC for this question. Write , using the transitive closure convention that contains and all its membership descendants.
First construct a set containing exactly the intended objects. If is a countable set, apply well-founded induction to membership on this transitive set. If all members of have countable set-theoretic rank, thenIndeed is countable, and a countable union of countable sets is countable in ZFC. The induction therefore gives . The collectionis now a genuine set by the axiom schema of separation inside the cumulative hierarchy level , and it contains every hereditarily countable set. It is a transitive set, since implies .
If is a countable subset of , thenThe right side is countable, so . Thus has countable-subset closure. This proves existence of a set with the required closure before taking any intersection.
To make the least-set argument precise, form the nonempty setIt is a subset of and contains . Its intersection is also closed: a countable subset of is a countable subset of every and therefore belongs to each such . For any set with the prescribed closure, , whence . This is leastness among all such sets, not just among subsets of .
Finally, well-founded induction on shows for every such : when all members of are in , the countable set is a countable subset of , so . Hence , proving that the definition gives precisely
For the cardinal bound, code the entire countable membership ancestry. A code is a triple , where , is a well-founded relation and an extensional relation, and is distinguished. There are at most such codes: and are coded by subsets of countable sets, and a Cantor pairing function with finitely many tags codes the triple as a subset of .
The well-founded recursiondefines its collapse, as in the Mostowski collapse theorem. The range is countable and transitive; thus each decoded belongs to . Conversely, for , choose a bijection and the point with . Set exactly when . Transitivity of makes this relation extensional, and Axiom of foundation makes it well-founded. The recursion then gives , so this code decodes to .
We have a surjection from a set of at most continuum many codes onto . Using the permitted axiom of choice, well-order the codes and assign each its least code; this is an injection. In fact every subset of is hereditarily countable, giving the reverse bound as well:
The axioms hold except Power Set. axiom of extensionality and Axiom of foundation are inherited by this transitive structure. The empty set and belong to it, giving the empty-set axiom and the axiom of infinity. The axiom of pairing follows from countable-subset closure. For , is a countable subset of , giving the Axiom of union. Any subset of is countable and lies in , so the axiom schema of separation holds for all formulas interpreted in .
For the Axiom schema of replacement, let a formula interpreted in assign a unique to each . Relativize that formula to the set and use the ambient Axiom schema of replacement to collect its range. The range is countable and consists of members of , hence belongs to . The same argument, selecting one witness for each member of the countable domain, proves axiom schema of collection. An ambient choice function on a family has a countable graph of ordered pairs of hereditarily countable sets. Each such pair is in , and countable-subset closure puts the graph in , proving the internal axiom of choice.
However, all external subsets of are elements of . An internal power set of would therefore have to be the full external , by transitivity and absoluteness of subset membership. That is uncountable by Cantor's theorem, whereas every member of is countable. Thus the axioms satisfied by hereditarily countable sets areHere the asserted axiom list includes both Axiom schema of replacement and axiom schema of collection; no equivalence relying on Power Set is being silently invoked.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 24 1 a i Solution Created 2026-10-03 Updated 2026-10-06
A strict partial order is a well-founded relation when every nonempty subset has a minimal member:In ZFC this is equivalent to the absence of an infinite descending sequence . A descending sequence violates the minimal-member property; conversely, repeatedly choosing a predecessor from a subset with no minimal member constructs such a sequence using the axiom of choice.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 24 4 b i Solution Created 2026-10-03 Updated 2026-10-06
The rank characterization holds for a set relation, or a set-like class relation. For such a well-founded relation, use well-founded recursion to defineThe predecessor set is a set, so the supremum is an ordinal. For a set-like class relation, the closure of the predecessors of any one point under finitely many predecessor steps is a set; perform the ordinary set recursion there. Uniqueness makes these local definitions agree, producing a class rank function. The formula immediately gives .
Conversely, suppose such an ordinal-valued function exists. For any nonempty subset, or nonempty subclass in the class formulation, take an element whose rank is least among the ranks occurring. It has no predecessor in that subset or subclass, because a predecessor would have smaller rank. This proves well-foundedness.
There is a qualification in the printed class formulation. If well-founded class relations are defined to include set-likeness, it is already implicit and the assertion is correct. Under the minimal-element definition alone, it must be supplied. Without set-likeness, let , where is not an ordinal, and put every ordinal below , with the usual ordinal order below it. Every nonempty subclass has a minimal element, so the relation is well founded. But transfinite induction forces for all ordinals, whereas would have to exceed every . No such ordinal exists. Thus the unrestricted class assertion is false; set-likeness is necessary for this standard rank proof.
Past exam of the mathematics course of the University of Cambridge 2015 ii Paper 3 13I ii Solution Created 2026-09-24 Updated 2026-10-06
Replace the strict partial order by its reflexive closure . Partially order all partial orders on extending by inclusion. A chain has an upper bound given by its union: transitivity and antisymmetry each concern finitely many pairs, which all lie in one member of the chain. By Zorn lemma there is a maximal extension .
If are incomparable under , defineThis adds . It is transitive: composing an old pair with a new one stays in the added set; composing two new pairs would require , which is impossible. It is antisymmetric: an added pair and a reverse old pair would again imply , and two reverse added pairs would do the same. Thus is a larger partial order, contradicting maximality. Therefore is total, and removing its diagonal gives a total order extending the original strict order.
A well-founded relation has a minimal element in every nonempty subset; with the axiom of choice this is equivalent to having no infinite strictly descending sequence. If an extension is a well-order, its least element in any nonempty subset is minimal for the original relation, so the original order must be well-founded.
However not every total extension need be a well-order. Take the empty strict order on , which is well-founded. Its extension defined by if in the usual order is total and has no least element.
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 121 1 ii Solution Created 2026-10-03 Updated 2026-10-05
The Mostowski collapse theorem applies when is a well-founded relation and an extensional relation on the set . Extensionality here means that different points have different sets of -predecessors. There is then a unique transitive set and a unique bijection such thatThe collapsing map is characterized by well-founded relation recursion:Thus is isomorphic to . Both well-foundedness and extensionality are hypotheses of the theorem; well-foundedness alone does not make the recursive map injective.
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 121 1 v a Solution Created 2026-10-03 Updated 2026-10-05
We construct the two transitive models together, taking care that the later collapse really retains the earlier model. First, a worldly cardinal is greater than : ZFC in contains the full power set , and the axiom of choice there gives a bijection between it and an ordinal . That power set is externally uncountable by Cantor theorem, so . Infinity rules out the finite cardinals and before this argument is applied.
By the Downward Lowenheim-Skolem theorem, choose a countable elementary substructure . Its inherited membership is a well-founded relation, and elementarity transfers extensionality from . Apply the Mostowski collapse theorem to obtain a countable transitive model of ZFC. Because is a countable transitive set, it is a hereditarily countable set and its rank of a set is below . In particular, .
Now take the Skolem hull in of the seedCall it . The seed has external cardinality and lies inside . The hull is an elementary substructure of with : closure under countably many finitary Skolem functions gives the upper bound, and gives the lower bound. Let be its Mostowski collapse theorem map. Then is a transitive model of ZFC.
The transitive collapse fixes transitive subsets lemma gives for every , since is transitive. Since also , the collapse sends that element to itself. Thus , and transitivity of yields the required inclusion:This is the construction of nested transitive models from a worldly cardinal; the next two parts verify its size and ordinal requirements.
Past exam of the mathematics course of the University of Cambridge 2018 ii Paper 4 16G Solution Created 2026-09-24 Updated 2026-10-03
The epsilon-recursion theorem says that for every definable operation assigning a set to each set and each function with domain , there is a unique class function such thatfor every set .
For uniqueness, suppose and both satisfy the recursion. If they agree on every , then their restrictions to agree and henceThe epsilon induction principle therefore gives .
For existence, call a function coherent on a transitive set whenThe same epsilon-induction argument shows that any two coherent functions agree on the intersection of their transitive domains. Assuming coherent functions have been constructed below every member of , their compatible union defines all values below ; adjoining the value prescribed by extends the construction to . Epsilon induction establishes this construction for every . The compatible local functions therefore unite to the required class function .
A relation on is well-founded when every nonempty subset of has an element with no -predecessor in that subset. It is extensional when
The Mostowski collapse theorem states that every well-founded extensional relation is isomorphic to membership on a unique transitive set . Define recursivelyWell-founded recursion makes well defined. Epsilon-style induction along , together with extensionality, shows that is injective. By definition,so is an isomorphism from onto , where . If , then for some , so ; hence is transitive. If another collapse has transitive range, induction gives , proving uniqueness.
Finally, suppose is finite. Its collapse is a finite transitive set, so every member of is hereditarily finite. Therefore every well-founded extensional relation on collapses to a transitive subset of .
Conversely, let be infinite. Choose the initial infinite ordinal equinumerous with . The successor ordinal has the same cardinality as . Pulling its membership relation back along a bijection gives a well-founded extensional relation on whose collapse is . But is not hereditarily finite, so . Consequently,
Past exam of the mathematics course of the University of Cambridge 2022 ii Paper 4 16F b i Solution Created 2026-09-24 Updated 2026-09-25
A relation on a set is well-founded when every nonempty subset of has an -minimal element. It is extensional when distinct elements have distinct predecessor sets:The Mostowski collapse theorem states that every well-founded extensional relation on a set is uniquely isomorphic to membership on a transitive set; the collapse is recursively
For the requested example, let and defineNo belongs to , and thereforeThe map is an isomorphism from membership on to membership on the von Neumann ordinal , so the Mostowski collapse is . On the other hand, already has rank , and hence the rank of is greater than .
For statement (i), suppose is isomorphic to with transitive. Membership is well-founded by the axiom of foundation. It is extensional on because transitivity ensures that the predecessors in of an element are exactly the elements of , and the axiom of extensionality distinguishes different sets. Both properties are preserved by isomorphism. Thus (i) is always true.
Past exam of the mathematics course of the University of Cambridge 2023 iii Paper 116 1 a Solution 2026-09-28
Write for the equivalence class of in the ultrapowerand define its membership relation byThe kappa-complete filter property makes well-founded: an infinite descending -chain would give countably many members of whose intersection belongs to , and every index in that intersection would yield an infinite descending membership chain, contradicting the Axiom of foundation. The relation is extensional by Łoś's theorem.
The Mostowski collapse theorem therefore gives a unique isomorphism onto a transitive set . Recursively, the notation missing from the printed formula may be defined byThe value is independent of the representative because it is defined on the ultrapower class . Moreover : every has its range contained in some with , since and the strongly inaccessible cardinal is regular; induction on the resulting rank bound keeps inside .
Define the ultrapower embeddingThe constant-function map into is elementary by Łoś's theorem, and is an isomorphism, so their composite is elementary.
Power-set-predecessor relation 2026-10-14
This well-founded relation is well-founded without the axiom of choice or Axiom of foundation. If a nonempty set lacked a minimal member, put . For each , some has , and gives . Hence . The Cantor diagonal argument applied to contradicts this inclusion.
Recursion (computer science) Created 2026-10-13 Updated 2026-10-18
Recursion solves a problem by invoking the same procedure on smaller instances, with base cases answered directly. For merge sort, an empty or one-entry array is already sorted, and every larger array is split into two shorter parts. The decreasing lengths justify termination; a self-call without a progress rule would not suffice.
A recursive procedure refers to itself, directly or through another procedure. A recursive call starts another invocation, with its own arguments and local variables; the caller can wait for its returned output. A base case supplies an answer without further recursive calls. To establish algorithm termination, also show that every recursive call progresses in a well-founded relation. “Smaller” means smaller in that chosen relation: argument values need not all decrease, and the arguments need not even be numbers.
Recursion is especially expressive when a data structure already decomposes into smaller structures. A binary tree has two child subtrees, so structural recursion can follow its shape. A short rule for each case can describe an entire traversal or computation. The distinction between a recursive procedure and the recursive process it generates helps connect that compact description to its resource use.[ref]
Structure and Interpretation of Computer Programs by Harold Abelson and others. Structure and Interpretation of Computer Programs, second edition, §1.2.1: procedure versus process; §1.2.2: closing discussion before Counting change, hierarchical data and straightforward definitions
Recursive powerset mapping 2026-10-14
A map is recursive if every map admits a unique with . This holds exactly when the predecessor relation is a well-founded relation. For the forward construction, take the union of all consistent partial solutions on downward-closed domains; well-founded induction proves compatibility, and a minimal missing point allows extension. Conversely, a nonempty subset with no minimal point has an upward reachability closure satisfying exactly when some predecessor is in . With and exactly when , both the zero map and the indicator of solve the recursion, contradicting uniqueness.
Transitive collapse fixes transitive subsets Created 2026-10-05 Updated 2026-10-14
If has a well-founded extensional inherited membership relation and is a transitive set, its Mostowski collapse theorem map fixes every member of . The recursion and well-founded relation induction give this pointwise. If also , then .
Well-founded induction Created 2026-10-06 Updated 2026-10-14
To prove a property at every point of a well-founded relation, prove that it holds at a point whenever it holds at all its predecessors.
Well-founded model of set theory 2026-10-03
A model of set theory is well-founded when its internally interpreted membership relation is a well-founded relation externally. By the Mostowski collapse theorem, every well-founded extensional set model is isomorphic to a transitive model.