Treat array entries as indexed occurrences, so equal numerical values may be selected independently. Put . Reject or . Define to mean that some subset of the first indices sums to . The base is and all other base entries are false. Considering whether index is selected givesOnly is needed, because all entries are positive. A one-dimensional implementation isDescending updates make both right-hand-side values belong to the previous list prefix: when updating , the smaller location has not yet been updated for this entry. This prevents using the same occurrence repeatedly. Induction on the list prefix proves the recurrence and the returned answer.
subsetSum(A, s):
S = sum of A
if s < 0 or s > S: return false
D[0..s] = false
D[0] = true
for each indexed entry a in A:
for t from s down to a:
D[t] = D[t] or D[t-a]
return D[s]The time is for nonempty input with , and space is . More generally one may fill through and answer every target from the same table. For a two-way equal partition, reject odd ; otherwise ask for target . A selected subset with that sum leaves its complement with the same sum. These are bounds polynomial in the numerical bound ; without that bound the method is pseudopolynomial in a binary-encoded unrestricted target.[ref]
Dynamic programming by Jeff Erickson. Chapter 3, §3.8, Subset Sum: include/exclude states and memoization
Use Horner's method, accumulating the high-degree coefficients before the low-degree ones:
def eval(x: Double): Double = {
var i = a.length
var value = 0.0
while (i > 0) {
i -= 1
value = a(i) + x * value
}
value
}At each while loop head the loop invariant isThe initial sum is empty. Decreasing
i and replacing the accumulator by a(i) + x * value extends that sum by one coefficient with the required powers shifted. The loop variant is i; on exit it is zero, so the accumulator equals . The code uses exactly multiplications and time, with constant auxiliary space, and also handles the empty coefficient array as the zero polynomial. Initializing from the last coefficient instead would save one multiplication for nonempty arrays.The invariant is an exact-arithmetic specification. With
Double, each arithmetic operation rounds; consequently the code evaluates the Horner expression in floating-point arithmetic, rather than guaranteeing the exact real value for arbitrary coefficients.The coefficient assumptions imply a nonconstant polynomial with and a positive leading coefficient. Thus as : dividing by its leading power of leaves the positive leading coefficient plus terms tending to zero. There is some with . A polynomial is continuous, so the intermediate value theorem supplies at least one positive root of a polynomial in .
This gives neither uniqueness nor monotonicity. Multiple crossings are possible. If the degree of a polynomial is an even integer, the same leading-term argument gives as , so there is also a negative root of a polynomial. For an odd integer degree of a polynomial no negative root of a polynomial is forced; a linear polynomial with negative constant coefficient and positive slope is a counterexample.
Maintain opposite signs at the endpoints, rather than assuming that the polynomial is monotone:
def floorRoot(X: Int): Int = {
require(X > 0 && eval(0.0) <= 0.0 && eval(X.toDouble) > 0.0)
var lo = 0
var hi = X
while (hi - lo > 1) {
val mid = lo + (hi - lo) / 2
if (eval(mid.toDouble) <= 0.0) lo = mid
else hi = mid
}
lo
}The loop invariant is and . Both branches preserve those signs, even when there are other roots of a polynomial or sign reversals elsewhere. When the interval width exceeds one, the midpoint is strictly between its endpoints, so the positive integer loop variant
hi - lo strictly decreases. On exit hi == lo + 1, giving the required postcondition . Continuity establishes a root of a polynomial between those adjacent integers, possibly at the left endpoint.The width is at most halved with rounding upwards, so there are at most midpoint evaluations, plus two endpoint evaluations in the precondition check. The midpoint expression avoids adding two large endpoints. The explicit positive upper-bound precondition supplies the interval order assumed in the question. For the literal computed-
eval contract, the same proof holds provided evaluated midpoints are not NaN; identifying its bracket with the real polynomial additionally requires trustworthy evaluation signs.First find a sign bracket by exponential search, then bisect that bracket without evaluating its endpoints again:
def floorRoot(): Int = {
require(eval(0.0) < 0.0)
var lo = 0
var hi = 1
while (eval(hi.toDouble) <= 0.0) {
lo = hi
require(hi <= Int.MaxValue / 2, "doubling bound exceeds Int range")
hi *= 2
}
while (hi - lo > 1) {
val mid = lo + (hi - lo) / 2
if (eval(mid.toDouble) <= 0.0) lo = mid
else hi = mid
}
lo
}For the first while loop the loop invariant is , with
hi a positive power of two, and either or . Every previously tested power of two has nonpositive value. Let be the least nonnegative integer for which . It exists by the positive leading coefficient. If the current upper endpoint is , a mathematical loop variant is while the guard holds; the next doubling decreases it by one. The first while loop's postcondition is . The second while loop has exactly the invariant, variant and adjacent-integer postcondition established in part c.There are evaluations at powers of two. If , the final bracket has width and takes exactly midpoint evaluations. Including the initial sign check, the total is evaluations for , and two for . Thus evaluation cost is for the first positive dyadic bound ; it is not a claim about the first positive root of a polynomial when the polynomial is nonmonotone.
The mathematical argument uses unbounded integer endpoints and reliable signs. The guarded
Int implementation requires the successful dyadic bound to fit in Int; otherwise it explicitly fails rather than wrapping to a negative bound. The coefficient assumptions alone cannot guarantee that a requested integer result fits a fixed-width type. Floating-point overflow or unreliable signs likewise need a wider or certified evaluator for a fully general implementation.For the pointwise order on real polynomials, proves reflexivity. Two opposite inequalities imply for every real ; the polynomials are therefore equal, proving the antisymmetric relation axiom. Chaining the inequalities at every proves transitivity.
To disprove total order, take and . The inequality fails at , whereas fails at . The order is partial but non-total.
Path identities in a rigid quiver representation Created 2026-10-06 Updated 2026-11-05
A base-change invariant polynomial identity holding on a rigid representation holds on its dense orbit and hence throughout the representation space. A path through nonzero vertex spaces cannot vanish identically there: assign every involved arrow a rank-one map carrying a chosen source vector to the chosen target vector. This works for repeated arrows. Consequently a nonzero path image in a rigid representation cannot be killed by an outgoing arrow into a nonzero vertex space.
Peano kernel of the third forward difference 2026-10-31
For , the third forward difference annihilates polynomials of degree at most two. Its Peano kernel is for , extended by zero outside that interval. It is times the quadratic cardinal B-spline evaluated at , is positive on , and has integral . The Peano kernel theorem therefore represents as a positive weighted average of the third derivative: for some interior when that derivative is continuous. The kernel is the smooth error weight hidden inside a discrete difference.
Peano kernel theorem Created 2026-09-24 Updated 2026-11-05
The Peano kernel theorem converts polynomial exactness into a derivative-based error formula. Let and let be a linear error functional annihilating every polynomial of degree below . A useful sufficient setting is a finite combination of point values, derivatives of orders below , and integrals against finite weights. For ,Here means for and zero for ; values at its finitely many evaluation breakpoints can be chosen arbitrarily for the outer integral. The proof applies to Taylor's theorem with integral remainder: the polynomial part vanishes, and the permitted evaluations and integrations interchange with the remainder integral. For a more general linear functional, that interchange is an additional hypothesis. The same construction makes B-splines Peano kernels of divided differences.[ref]
Math/CS 887: Approximation Theory by Carl de Boor. Taylor identity and equation(85), printed p54
For the midpoint error , use . Its nonnegative kernel equals on the left half and on the right half. Its integral is , immediately yielding the sharp quadrature error bound.
Pencil (geometry) 2026-10-13
A pencil is a one-parameter linear family of geometric objects. For linearly independent homogeneous polynomials of equal degree, , indexed by , is a pencil of plane curves or hypersurfaces. Lines through a fixed point give a simple example; a pencil of plane curves specializes the general construction.
Percolation critical probability Created 2026-09-28 Updated 2026-10-14
For the rooted infinite model defining percolation probability, the percolation critical probability isBelow , the root has probability zero of belonging to an infinite percolation cluster. Above , that probability is positive, by the definition and the monotone coupling of Bernoulli percolation. The definition alone does not determine behavior at , or the numerical value of : these require results specific to the graph and the model.
A finite graph with edges has open/closed configurations. The probability of any connectivity event is a finite sum of terms , hence a polynomial in . The square's is an example. These finite probabilities vary smoothly, although an infinite-system limit can distinguish a whole interval with from one with . A steep finite connection curve and a mathematically proved percolation critical probability are different kinds of information.
Picard iteration Created 2026-10-14 Updated 2026-10-31
Picard iteration replaces a tentative trajectory by the accumulated integral of its proposed rate. For an initial value problem , , define the Picard map and its starting function byHere is the constant starting trajectory; the same symbol without its argument denotes the initial state. A fixed point of solves this integral equation, and the fundamental theorem of calculus gives the original ordinary differential equation.
For , , successive integrals giveAt , the first five values are , while . The fourth polynomial misses by about . On , every omitted term of the exponential series is nonnegative and increasing, so the largest error occurs at . The tail tends to zero, giving uniform convergence to the exponential function on this interval.
Picard iteration builds the exponential solution by repeated integration
. The first five polynomials approach the exponential function on . Endpoint values are listed in the legend; the last error is approximately . Details.The beauty of Picard iteration is that each proposed trajectory supplies a better rate history for the next one. For this example, one integration adds exactly the next term of the exponential series. In general, the integrals may be difficult to compute, but the construction still explains local existence and uniqueness.
The short contraction mapping argument needs two independent controls. Choose a time-state cylinder on whichThe second bound is the uniform local Lipschitz condition. Set with , and . In the function space of continuous functions , use the supremum norm . On its closed ball , direct integral estimates giveThus the map preserves the closed ball and is a contraction mapping there. This closed ball is a complete metric space, so the contraction mapping theorem gives convergence to exactly one fixed point. Any other local solution of a differential equation stays in the same ball after shortening its interval, and hence agrees there.
For , take , so in the state ball and , . Choosing gives and , with the actual solution satisfying . The plotted interval is longer than this simple guarantee: the explicitly computed exponential series converges there anyway. The condition is sufficient for this one-step contraction mapping argument, rather than a necessary lifespan bound.
Picard-Lindelöf theorem Created 2026-09-24 Updated 2026-10-14
Let be an open set and a continuous function. Suppose is locally Lipschitz in the state , with a Lipschitz constant uniform on a sufficiently small time-state neighborhood of each point. Then each determines a unique local solution of a differential equation to the displayed initial value problem, on an interval around . This is the local theorem in Ordinary Differential Equations and Dynamical Systems by Gerald Teschl.
For example, , , has the solution of a differential equation : its derivative is itself and its starting value is . The Lipschitz constant is , since . Thus uniqueness follows even before computing . Picard iteration below constructs this exponential function one polynomial at a time.
The Lipschitz condition has real content. For the continuous function involving a square root,each waiting time gives a different forward solution of a differential equation:The constant solution of a differential equation is another choice. At , delays give respectively. Before the join, both sides of the ordinary differential equation are zero; afterwards, . Both one-sided derivatives at are zero, so the join is valid. All these trajectories can also be extended by zero to . The failed Lipschitz condition is visible in the quotientFor this quotient is . Continuity still allows local existence by the Peano existence theorem; it cannot choose a waiting time. MIT's 18.034 Lecture 2, Example 2.3 develops the same waiting-time mechanism for a different ordinary differential equation, .
Failure of uniqueness and finite-time blowup are different obstructions
. Left: several delayed solutions of a differential equation of share . Right: the unique solution of a differential equation of , , has finite-time blowup at . The right vertical axis ends at ; the curve continues upward beyond the plot, and there is no finite endpoint value. Details.The useful promise is that an initial condition and a sufficiently regular local rule select one trajectory. It justifies comparing models and following trajectories without an arbitrary choice at each instant. A locally Lipschitz continuous rule need not keep that trajectory bounded: meets the theorem's hypotheses everywhere but has finite-time blowup. Longer existence is governed by the finite-dimensional continuation criterion.
Piecewise polynomial function Created 2026-10-05 Updated 2026-11-05
A piecewise polynomial function agrees with a polynomial on each member of a partition. Approximation claims usually require finitely many pieces with controlled interfaces. In one dimension, finitely many partition points and localized wavelets with more vanishing moments than the polynomial degree leave only a bounded number of nonzero coefficients per scale, yielding exponential squared best N-term approximation error.
Piotr Hajłasz 2026-11-05
Piotr Hajłasz authored notes on functional analysis developing Banach spaces, Hilbert spaces and the Baire category theorem. One application proves that a smooth real function is a polynomial if, at every point, at least one of its derivatives vanishes. The proof illustrates how a countable union of local conditions can force a global algebraic conclusion.[ref]
Plane curve Created 2026-09-24 Updated 2026-10-25
A plane curve is a curve contained in a plane. In algebraic geometry, one studies plane curves defined by polynomial equations. General plane curves, such as an Archimedean spiral, need not be algebraic curves.
Pointwise order on real polynomials Created 2026-10-25 Updated 2026-10-31
This is a partial order: the real inequalities supply reflexivity and transitivity, while inequalities in both directions give equality of the polynomials as functions. It is not a total order, since the polynomials and are incomparable on all of . Restricting the test domain can change the relation; testing only at finitely many points need not distinguish different polynomials.
There is a sequence of complex polynomials converging pointwise on the whole plane to the sign of the imaginary part, with value zero on the real axis. For each , take the compact union of the upper rectangle , its lower reflection and the real segment . Its complement is connected. The function equal to one, minus one and zero on disjoint neighborhoods of the three components is holomorphic. The polynomial Runge theorem provides a polynomial within of it on the union. Every fixed point lies in its corresponding component for all large , proving pointwise convergence. The limit is discontinuous, so the convergence cannot be locally uniform near the real axis. This illustrates how pointwise approximation by holomorphic functions differs from locally uniform approximation.
Pointwise vanishing derivative criterion for a polynomial Created 2026-10-03 Updated 2026-10-07
Suppose that for every , at least one derivative of an entire function vanishes. The closed sets cover . By the Baire category theorem, some has nonempty interior. The identity theorem gives everywhere, so is a polynomial of degree below .
Polar curve Created 2026-10-25 Updated 2026-10-31
For a homogeneous polynomial of degree , its first polar with respect to is the equation , of degree when this polynomial is nonzero. Every singular point of lies on every such polar. Polars turn the Bézout's theorem intersection count into bounds on singularities and tangencies. The equation is covariant under a linear change of homogeneous coordinates, by the chain rule.

