Slope presentations of convex height sequences #
A nonempty convex polygon is determined by its first point and the slopes of its unit edges. This file gives the two one-sided presentations of that kind.
FiniteSlopeData Γ: a starting index, an initial height, a horizontal lengthdand nondecreasing slopes indexed byFin d. Length zero is a singleton polygon; the empty polygon has no presentation.InfiniteSlopeData Γ: a starting index, an initial height and a nondecreasing sequence of slopes indexed byℕ, describing a polygon whose finite domain is a half-line.
The slopes and the initial height lie in a preordered additive commutative monoid Γ, such
as ℕ, ℚ or ℝ, rather than in a type containing slope sentinels. The represented heights
are cumulative sums on the finite domain and ⊤ outside it, so every actual edge has horizontal
length one.
Main results #
FiniteSlopeData.heights_injective,InfiniteSlopeData.heights_injective: slope data is determined by the heights it represents.FiniteSlopeData.heights_map,InfiniteSlopeData.heights_map: compatibility with order-preserving additive maps of value monoids, such asℚ → ℝ.FiniteSlopeData.isConvexSeq_heights,FiniteSlopeData.unitSlope_heights: real slope data represents a convex height sequence whose unit slopes are the given ones.FiniteSlopeData.ofIsConvexSeq,FiniteSlopeData.heights_ofIsConvexSeq,FiniteSlopeData.ofIsConvexSeq_heights: extraction of slope data from a convex height sequence with a specified finite domain, and both round trips.FiniteSlopeData.exists_heights_eq_iff: a height sequence has finite real slope data exactly when it is convex with nonempty finite domain.- The corresponding
InfiniteSlopeDatastatements, for convex height sequences with infinite domain.
References #
- N. Koblitz, p-adic Numbers, p-adic Analysis, and Zeta-Functions, Chapter IV §3.
- A cumulative-sum construction of heights from monotone slopes also appears in William
Coram's
PhD/Main/NewtonPolygons/OfSlopes.leanat revisioneefb3d91f34b27d0bc7822140fa85fecae029884.
Finite slope data #
The unit-slope presentation of a nonempty convex polygon with finite domain
[start, start + length]. The edge from start + i to start + i + 1 has slope slope i.
Length zero represents a singleton polygon and carries no slopes.
- start : ℕ
The first index of the finite domain.
- initialHeight : Γ
The height at the first index.
- length : ℕ
The horizontal length of the polygon, which is also its number of unit edges.
The slope of the
i-th unit edge, counted from the left.Slopes are nondecreasing from left to right.
Instances For
Finite slope data is determined by its anchor, length and pointwise unit slopes, transported along the equality of lengths.
The heights represented by finite slope data: cumulative slope sums on
[start, start + length] and ⊤ elsewhere.
Instances For
The defining formula of FiniteSlopeData.heights at an arbitrary index.
On the finite domain, the height is the initial height plus a partial slope sum.
The height at the first index is the initial height.
The height at the right endpoint exceeds the initial height by the sum of all slopes.
Transport finite slope data along an order-preserving additive map of value monoids.
Instances For
The heights of transported slope data are the transported heights.
Finite slope data is determined by the heights it represents: the starting index, the initial height, the length and every slope agree.
Infinite slope data #
The unit-slope presentation of a convex polygon whose finite domain is the half-line
[start, ∞). The edge from start + i to start + i + 1 has slope slope i. A terminal
ray is an eventually constant slope sequence; no slope is infinite.
- start : ℕ
The first index of the finite domain.
- initialHeight : Γ
The height at the first index.
- slope : ℕ → Γ
The slope of the
i-th unit edge, counted from the left. Slopes are nondecreasing from left to right.
Instances For
Keep the anchor and first n unit slopes of an infinite slope presentation.
For n = 0 the truncation is the singleton at the anchor.
Instances For
The heights represented by infinite slope data: cumulative slope sums from start
onwards and ⊤ before it.
Instances For
The defining formula of InfiniteSlopeData.heights at an arbitrary index.
The represented heights are finite exactly on [start, ∞).
The represented heights are infinite exactly before start.
On the finite domain, the height is the initial height plus a partial slope sum.
Truncation preserves heights on the interval from the anchor to its endpoint.
The height at the first index is the initial height.
Transport infinite slope data along an order-preserving additive map of value monoids.
Instances For
The heights of transported slope data are the transported heights.
Infinite slope data is determined by the heights it represents: the starting index, the initial height and every slope agree.
Real slope data and convex height sequences #
Real finite slope data represents a convex height sequence.
Reconstructing heights and extracting slope data recovers the slope data.
A real height sequence is represented by finite slope data exactly when it is convex and its finite domain is nonempty and finite.
Real infinite slope data represents a convex height sequence.
Reconstructing heights and extracting slope data recovers the slope data.