The feature decomposition of number #
Harbour decomposes the three basic number values into two features, [±atomic] and [±minimal]. A
bundle is the set of its positive features, and it passes the containment filter when they form a
lower set of the chain minimal < atomic, so the three values are the chain's initial segments. For
number the filter follows from the semantics: an atom is minimal in every region excluding the
null individual (Number.singular_subset_minimal), so [+atomic, −minimal] corresponds to no
number, as Harbour observes. Lattice elements are classified by the regions of Harbour's
features (Semantics/Plurality/Number.lean).
Main definitions #
Number.Feature,Number.Features: the two features and their bundles, withFeatures.toNumberandFeatures.ofNumberrelating bundles toNumber.Number.latticeToFeatures: the bundle a lattice element realizes in a region, singular on its atoms, dual on its minimal non-atoms, plural otherwise.Number.dualPredOnLattice: the dual as a predicate modifier.
Main results #
Number.card_wellFormed: exactly three bundles pass the containment filter.Number.toNumber_isSome_iff,Number.ofNumber_toNumber,Number.toNumber_ofNumber: bundles and values correspond on those cells.Number.latticeToFeatures_wellFormed: classification never produces the filtered cell.Number.dualPredOnLattice_iff: the dual predicate modifier is the restriction to elements classifieddualF.
Implementation notes #
Harbour argues that the features are bivalent, a privative encoding collapsing values such as
unit augmented and minimal; a bundle here is the set of positive values of a bivalent valuation,
the negative values being its complement. The examples use the powerset lattice Finset (Fin n)
on its nonempty subsets, whose atoms are the singletons.
References #
The feature bundle #
Equations
- Number.instDecidableEqFeature x✝ y✝ = if h : x✝.ctorIdx = y✝.ctorIdx then isTrue ⋯ else isFalse ⋯
Equations
- Number.instReprFeature.repr Number.Feature.minimal prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Number.Feature.minimal")).group prec✝
- Number.instReprFeature.repr Number.Feature.atomic prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Number.Feature.atomic")).group prec✝
Instances For
Equations
- Number.instReprFeature = { reprPrec := Number.instReprFeature.repr }
Equations
- Number.instFintypeFeature = { elems := { val := ↑Number.Feature.enumList, nodup := Number.Feature.enumList_nodup }, complete := Number.instFintypeFeature._proof_1 }
Equations
- Number.instLinearOrderFeature = LinearOrder.lift' Number.Feature.rank Number.instLinearOrderFeature._proof_1
A number feature bundle is the set of its positive features.
Equations
- Number.Features = Finset Number.Feature
Instances For
The singular is [+atomic, +minimal], the whole chain.
Equations
- Number.singularF = Finset.Iic Number.Feature.atomic
Instances For
The dual is [−atomic, +minimal], the chain below atomic.
Equations
- Number.dualF = Finset.Iic Number.Feature.minimal
Instances For
The number value a bundle realizes; the ill-formed [+atomic, −minimal]
realizes none.
Equations
- f.toNumber = if Number.Feature.atomic ∈ f then if Number.Feature.minimal ∈ f then some Number.singular else none else if Number.Feature.minimal ∈ f then some Number.dual else some Number.plural
Instances For
The bundle of a basic number value; the values that need feature recursion or additivity have none.
Equations
Instances For
Exactly three bundles pass the containment filter, the three basic number values.
Classification by lattice position #
A lattice element realizes, in the region P, the singular on the atoms of P, the dual on
its minimal non-atoms, and the plural on the rest.
Equations
- Number.latticeToFeatures P x = if Number.atomsOf P x then Number.singularF else if Number.dualOf P x then Number.dualF else Number.pluralF
Instances For
Classification never produces the ill-formed cell.
The dual as a predicate modifier holds of x when P x and x has exactly two atomic parts,
being a minimal non-atom of the region domain
([JBG+25] (39)).
Equations
- Number.dualPredOnLattice domain P x = (P x ∧ Number.dualOf domain x)
Instances For
The dual predicate modifier is the restriction of P to the elements
classified dualF.
The powerset lattice #
The nonempty subsets of Fin 3, a lattice with three atoms.
Equations
- Number.ps3 s = s.Nonempty
Instances For
Equations
- Number.instDecidablePredFinsetFinOfNatNatPs3 s = { decide := decide (∃ a ∈ s, true = true), reflects_decide := ⋯ }