Scale granularity #
A granularity function of width w maps each degree to an interval of width w that contains
it. The grain of width ε is the granularity function that reports each degree by the nearest
multiple of ε: degrees with the same nearest multiple are indistinguishable, and the cell of a
degree is the half-open interval of width ε centred on that multiple. Krifka builds levels of
precision this way, Sauerland and Stateva define granularity functions by the properties
collected in IsGranularity, and Deo and Thomas take the cells of a grain as the answers to a
degree question.
A finer grain is a narrower one, not a refinement. No cell of a wider granularity function fits
inside a cell of a narrower one, and a grain refines the grain k times as wide exactly when k
is odd, so halving the width never refines. Around a common multiple of two widths the cells are
nested.
Main definitions #
Degree.IsGranularity: a granularity function of a given width.Degree.grain: the partition of the scale by nearest multiple ofε.Degree.representative: the nearest multiple ofε.
Main results #
Degree.cell_grain: a cell is the half-open interval of widthεcentred on its representative.Degree.IsGranularity.not_subset: a cell of a wider granularity function never fits inside a cell of a narrower one.Degree.isGranularity_zero_iff: the granularity function of width zero is the exact reading, every cell a single degree.Degree.cell_grain_subset_cell_grain: around a common multiple, a finer cell lies inside a coarser one.Degree.grain_le_grain_iff_odd: the grain of widthεrefines the grain of widthk * εexactly whenkis odd.
Implementation notes #
Cells are half-open, the only choice of endpoints that partitions the scale; Sauerland and Stateva
write closed intervals and Thomas and Deo open ones. IsGranularity states the width by placing
each cell between the open and the closed interval of that width, which leaves the endpoints
open, as Thomas and Deo recommend, and needs no sSup, which ℚ lacks.
References #
A granularity function of width w maps each degree to a set that contains it and lies
between the open and the closed interval of width w with a common left end.
- mem_self (s : D) : s ∈ γ s
Every degree lies in its own cell.
- exists_Ioo_subset_subset_Icc (s : D) : ∃ (a : D), Set.Ioo a (a + w) ⊆ γ s ∧ γ s ⊆ Set.Icc a (a + w)
Every cell is an interval of width
w, whichever of its endpoints it contains.
Instances For
The cells of a granularity function are convex.
The granularity function of width zero is the exact reading, every cell a single degree.
A cell of a wider granularity function never lies inside a cell of a narrower one.
The grain of width ε identifies two degrees when they have the same nearest multiple of
ε.
Equations
- Degree.grain ε = Setoid.ker fun (d : α) => round (d / ε)
Instances For
The representative of d at width ε is the nearest multiple of ε.
Equations
- Degree.representative ε d = round (d / ε) • ε
Instances For
Only scale points are reported.
The representative of d is the multiple of ε nearest to d.
The cell of d is the half-open interval of width ε centred on its representative.
The grain moves a degree by exactly half its width at the points that halving the width adds to the scale.
The degrees reported as a scale point are its cell, the half-open interval of the grain's width centred on it.
Two degrees the grain of width ε identifies are less than ε apart.
Around a common multiple of two widths, the cell of the finer grain lies inside the cell of the coarser one.
The grain of width ε refines the grain of any odd multiple of its width.
The grain of width ε refines no grain of an even multiple of its width, since the boundary
j * ε of the coarser grain is the centre of a cell of the finer one.
The grain of width ε refines the grain of width k * ε exactly when k is odd.