Slowly varying function Created 2026-10-05 Updated 2026-10-14
A positive measurable function is slowly varying at infinity if
for every fixed . It has regular variation of index zero. “Slowly” concerns relative change under multiplication of the argument; it does not mean that the function must be bounded, have a small derivative, or converge to a finite value.
Every positive constant is a slowly varying function. So are , and for any fixed real number , on . Indeed,
The first grows without bound, the second tends to zero, and the constant does neither. Another unbounded example is :
This function can grow much faster than while retaining regular variation of index zero.
Even convergence is unnecessary. The bounded function
oscillates between and . It is nevertheless a slowly varying function: the change in the argument of the sine under is
and the Lipschitz continuity of the sine makes the logarithm of the ratio tend to zero. The sequences and give the two values and for every nonnegative integer , so there is no limit at infinity.
Contrast this with , which is positive and bounded but is not a slowly varying function. Fix . Along its rescaling ratio is ; along the ratio is . The persistent oscillations prevent even a limit for this one fixed rescaling. It is not regularly varying with any finite index either.
Figure 1.
Two bounded oscillating functions: logarithmic rescaling makes one ratio approach one, while the other keeps oscillating
. The horizontal coordinate is , and the fixed rescaling is . The displayed range illustrates the formulas; the limiting claims follow from the arguments in the text. Details.
The useful distinction is whether a fixed proportional change of input eventually produces a negligible proportional change of output. A slowly varying function can therefore preserve the scaling exponent of a power law while changing its magnitude substantially. The decomposition in regular variation explains why a logarithmic factor can matter in numerical estimates without changing the limiting exponent.
Sortedness 2026-10-13
For an output sequence of length , sortedness means
under the chosen total order on sort keys. Its transitivity also gives whenever . An empty sequence and a one-entry sequence satisfy sortedness without any adjacent comparison. For longer sequences, checking adjacent pairs suffices; checking only the first and last sort keys does not. For example, passes an endpoint comparison but fails sortedness at . Sortedness alone says nothing about which input entries survived.
Sorted run 2026-10-31
A contiguous nondecreasing segment of a sequence. Adjacent sorted runs can be merged in time linear in their combined lengths.
Sorting 2026-10-20
Rearranging a finite sequence according to a specified order while preserving its entries and their multiplicities. A sorting algorithm performs this operation; lexicographic order supplies a common order for tuples or strings.
Sorting algorithm 2026-10-13
A sorting algorithm rearranges a finite sequence into nondecreasing order under a chosen total order on its keys. Its output must contain every input entry exactly once, including repetitions: producing ordered values is insufficient if entries are lost. Merge sort is one such algorithm; stable sorting adds a requirement about equal keys.
Sorting creates reusable structure: equal sort keys become adjacent, and a sorted array supports binary search. However, an algorithm correctness check must establish both sortedness and sorting permutation preservation. Replacing every entry by the smallest key can produce ordered keys while destroying the original data. Stable sorting imposes a third condition when equal sort keys occur: retain their arrival order.
For example, take complete sorting records , with the first component as the sort key and the letter as associated data. A correct output is . The sort keys are ordered, every complete sorting record remains, and the equal-key pairs keep before and before . The output satisfies sortedness and sorting permutation preservation, but fails stable sorting. The output has the right multiset of sort keys but loses and duplicates ; it fails sorting permutation preservation of complete sorting records.
To express stable sorting precisely, label every input occurrence by its original position, even when two complete sorting records have identical contents. Let be the output position of the occurrence originally at position . Besides sortedness and sorting permutation preservation, require
Here is the sort key function. Sorting by the pair under lexicographic order gives the same order as stable sorting by : the original position breaks ties without discarding associated data. For a two-field ordering, first apply stable sorting by the secondary sort key, then apply stable sorting by the primary sort key. The second pass retains the secondary order within each group of equal primary sort keys. For instance, first becomes by letter, then by number.
The output of a sorting algorithm must be a permutation of the complete input sequence. For equal lengths , require a permutation of such that
Equivalently, the input and output have the same multiset of complete entries: each entry has the same multiplicity. Equality of the underlying sets is insufficient; and have the same set of values and the same length but different multisets. When tracking occurrences rather than contents, retain original identity labels to check that each one is moved exactly once. A swap preserves this multiset automatically; an overwrite need not.
Define a sequence by when is a power of two, including , and otherwise. Every tail of a sequence contains both a later power of two and a later nonpower. Therefore and , and the sequence does not converge. Its peak indices become increasingly sparse, yet never stop appearing.
Through index , the number of peaks is , so their fraction is
The set of powers of two has natural density zero. The same fraction is the Cesàro mean of the first terms, which tends to zero even though the limit superior stays one. At , eleven peaks give mean . An average and a long-run upper edge answer different questions about the same sequence.
Figure 1.
Peaks of zero natural density retain a limit superior of one while their Cesàro means tend to zero
. Left: the indicator sequence has peaks at powers of two; every sufficiently late tail still contains peaks and zeros. Right: the exact peak count divided by decreases overall toward zero, with jumps when a new power of two enters the count. These finite plots illustrate formulas valid at every positive integer index. Details.
Take , the nonnegative integers, and , the positive integers. Choose the injections
Here is an inclusion map, while reaches only the positive even integers. In particular, is not a bijection: it misses every positive odd integer. Simply using the inverse function of on its image misses input zero.
The remedy is to follow the alternating injections starting at the missing input zero:
The subscripts distinguish an input in from an output in , even when their numerical values agree. The resulting subset of is . Its sequence of members satisfies and , giving by mathematical induction. Define the function
Figure 1.
A bijection moves only the sequence
. The upper row alternates the original injections and . Solid blue arrows are the chosen bijection on ; dashed gray arrows only continue the chain. Below, examples outside use and keep their numerical values. Every displayed number belongs to the explicitly constructed example. Details.
The image covers all the positive members of exactly once. The other inputs cover exactly once by staying fixed. These output sets are disjoint and their union is , proving that is a bijection. In particular, , , , while and .
For completeness, its inverse function is
The familiar bijection also works, but this example shows something more specific: the two chosen injections can repair the missing zero by moving only a sparse sequence of inputs. The repair never has to shift the entire set.
Suppose are bounded functions on the same nonempty set, and the supremum norm of their difference is at most . Then their optimal values differ by at most the same amount:
Indeed, for every , so ; exchange and for the other direction. Adding a constant shifts a supremum by that constant, a basic compatibility between upper bounds and addition.[ref]
For a chosen example on , take and . Their supremum error is , since . Completing the square gives
Thus has maximum zero at , while has maximum at . The change in optimal value, , is smaller than the certified bound . For the vertical translation , the bound is exact: its supremum error and optimal-value change are both .
Figure 1.
Uniform error controls the optimal value; maximizing inputs require additional control
. Original polynomial examples on . Left: and lie within a vertical error band of , while their maxima differ by . Right: the small tilts and have maximizing inputs and for every ; solid lines use and dashed lines use . These chosen examples are not measured errors or claims about an arbitrary optimizer. Details.
A stable optimal value does not guarantee a stable maximizing input. On , the two linear functions and satisfy
For every positive , their unique maximizing inputs remain two units apart, at and . Both functions approach the flat zero function, which has many maximizing inputs. Consequently an accurate objective function value is not by itself a certificate that the optimizing decision is accurate.
The estimate also gives a convenient consequence of uniform convergence. If converges uniformly to a bounded function on a nonempty , then for the bounded tail of the sequence. Uniform control handles the changing input that defines the best value. Pointwise convergence alone supplies no such control; the existing examples under uniform convergence illustrate that distinction.
Let and give each factor of the usual topology of the real line. The familiar standard basis vectors extend to unit sequences with when and zero otherwise. Their finite linear combinations are exactly the finitely supported sequences, rather than all of .
For every fixed coordinate , for all . Therefore in the product topology. More directly, any basic cylinder set containing zero contains every with : all of its tested coordinates are then zero. The moving unit entry escapes every fixed finite collection of observations.
Figure 1.
A moving unit entry escapes each fixed finite-coordinate cylinder
. Only coordinates 1 and 3 are tested in the displayed cylinder, with values required to lie between minus one-half and one-half. All later coordinates remain unrestricted. The finite display illustrates the pattern; the threshold argument in the text applies to every finite coordinate set. Details.
In the l-infinity sequence space of bounded real sequences, however,
Thus the same sequence does not converge to zero in the supremum norm. Here the comparison is between the subspace topology inherited from the product topology and the norm topology on . The supremum norm is not a finite-valued norm on all of , which also contains unbounded sequences. In the box topology on , the neighborhood of zero excludes every , so is not a convergent sequence with limit zero there either.
Stateless iterator 2026-10-24
An iterator whose future observable sequence can be produced without changing cursor state. An infinite constant sequence is an example: removing its first element leaves the same sequence. A permanently empty iterator is another. Such cases show why an iterator interface does not logically force every implementing object to be mutable, although ordinary finite nonempty traversals need progress state somewhere.
Strict buffer 2026-10-31
A process with finite positive capacity whose output sequence is a prefix of its input sequence and whose input-output length discrepancy never exceeds that capacity. While active, it offers input whenever non-full and output whenever nonempty; upstream closure drains retained data, while downstream closure cancels delivery.
A strictly increasing subsequence selects indices of a sequence with . Equal values cannot both occur in it. Its maximum possible length is , with ; in general for the weak longest increasing subsequence. Use strict comparisons in the dynamic programming recurrence relation and replace the first tail at least as large as the next value in the binary search algorithm.
Subsequential limit Created 2026-10-14 Updated 2026-10-25
A subsequential limit of a sequence is a value approached by some subsequence with strictly increasing indices . For , the subsequences at even integers and odd integers give subsequential limits one and minus one. A finite value appearing among only finitely many initial terms does not become a subsequential limit merely by being a member of the image of a function represented by the sequence.
For a bounded sequence of real numbers, its subsequential limits form a nonempty bounded set that is also a closed set. The Bolzano-Weierstrass theorem guarantees nonemptiness, and its extreme values are the limit inferior and limit superior. The sequence in sparse peaks can determine a limit superior has the two subsequential limits zero and one, despite almost all indices in the natural density sense carrying zero.
Subshift of finite type 2026-10-14
A subshift of finite type is a closed subset of a finite-alphabet full shift defined by finitely many forbidden finite words, with the restricted left shift. After replacing symbols by sufficiently long blocks, its constraints can be described by a zero-one symbolic transition matrix. In this presentation, membership means that every consecutive pair follows an allowed transition. The resulting sequence space is a compact metric space and the restricted left shift is a homeomorphism.
Subtree-size balance 2026-10-24
The condition that each binary-tree vertex has child subtrees whose node counts differ by at most one. Recursively choosing the middle entry of an index interval establishes this condition at every vertex, with exactly one allocated node per entry. No ordering assumption on the stored values is needed for the balance property or for reproducing the input's inorder sequence.
If a sequence in a metric space has , the triangle inequality gives for . The tail of this convergent series tends to zero and bounds every later pair, proving the Cauchy sequence condition. In particular, an increment bound with and gives by the geometric series. Unlike checking a small latest step, this bounds all remaining movement.
This sufficient condition is not necessary. The real sequence converges to zero and is therefore a Cauchy sequence, although has a divergent sum. Cancellation allows convergence despite infinite accumulated absolute values of the successive changes.
Suppose a numerical sequence has period from index , and let . For with , split the required sum into complete periods and a tail of length . Every complete period contributes , proving the formula in the title. Precomputed prefix sums of one period make the tail lookup constant time. If this periodic sequence consists of the first differences of another sequence, the same formula extrapolates that original sequence by adding the initial value at .
The tail diameter of a sequence in a metric space is , allowing . The bounds are nonincreasing as grows because fewer pairs remain. A sequence is a Cauchy sequence exactly when . The supremum need not be attained: for , even though no two finite terms achieve that difference. For , for every . For the harmonic numbers, for every , because each remaining tail is unbounded.