Discrete degree carriers #
The finite, Fin-backed scale carriers used by RSA fragments and
computational Studies [Ken07] [Hei01] [KMcN05]:
Bounded max / Threshold max with their order/Fintype instances, and
the threshold-comparison predicates (tall / short / not tall).
The abstract theory works with plain measure functions μ : E → D into
a preorder (Comparative.lean, Extent.lean); this module is its
decidable discretization.
Main definitions #
Bounded max,Threshold max— discrete bounded scale types.deg,thr— literal constructors.positiveMeaning,negativeMeaning,notPositiveMeaning— the three opposition relations as decidable threshold comparisons.
Discrete bounded scales #
A degree on a scale from 0 to max — a discretized continuous value
(height, temperature, …).
- value : Fin (max + 1)
Instances For
Equations
- Degree.instReprBounded.repr x✝ prec✝ = Std.Format.bracket "{ " (Std.Format.nil ++ Std.Format.text "value" ++ Std.Format.text " := " ++ (Std.Format.nest 9 (repr x✝.value)).group) " }"
Instances For
Equations
- Degree.instReprBounded = { reprPrec := Degree.instReprBounded.repr }
Equations
- Degree.instDecidableEqBounded.decEq { value := a } { value := b } = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
Equations
- Degree.instInhabitedBounded = { default := { value := ⟨0, ⋯⟩ } }
Bounded max inherits a linear order from Fin (max + 1).
Equations
- Degree.instLinearOrderBounded = LinearOrder.lift' Degree.Bounded.value ⋯
All degrees from 0 to max.
Equations
- Degree.allDegrees max = List.map (fun (x : Fin (max + 1)) => { value := x }) (List.finRange (max + 1))
Instances For
Bounded from Nat (clamped to max).
Equations
- Degree.Bounded.ofNat max n = { value := ⟨min n max, ⋯⟩ }
Instances For
The numeric value of a degree.
Instances For
A threshold for a gradable adjective: x is "tall" iff degree x > threshold.
- value : Fin max
Instances For
Equations
- Degree.instReprThreshold = { reprPrec := Degree.instReprThreshold.repr }
Equations
- Degree.instReprThreshold.repr x✝ prec✝ = Std.Format.bracket "{ " (Std.Format.nil ++ Std.Format.text "value" ++ Std.Format.text " := " ++ (Std.Format.nest 9 (repr x✝.value)).group) " }"
Instances For
Equations
- Degree.instDecidableEqThreshold.decEq { value := a } { value := b } = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
Equations
- Degree.instInhabitedThresholdOfNeZeroNat = { default := { value := ⟨0, ⋯⟩ } }
Threshold max inherits a linear order from Fin max.
Equations
- Degree.instLinearOrderThreshold = LinearOrder.lift' Degree.Threshold.value ⋯
All thresholds from 0 to max - 1.
Equations
- Degree.allThresholds max x✝ = List.map (fun (x : Fin max) => { value := x }) (List.finRange max)
Instances For
The numeric value of a threshold.
Instances For
Equations
- Degree.instFintypeBounded = Fintype.ofEquiv (Fin (max + 1)) { toFun := Degree.Bounded.mk, invFun := Degree.Bounded.value, left_inv := ⋯, right_inv := ⋯ }
Equations
- Degree.instFintypeThresholdOfNeZeroNat = Fintype.ofEquiv (Fin max) { toFun := Degree.Threshold.mk, invFun := Degree.Threshold.value, left_inv := ⋯, right_inv := ⋯ }
Coercion: a Threshold embeds into Bounded via Fin.castSucc.
Equations
- Degree.instCoeThresholdBounded = { coe := fun (t : Degree.Threshold max) => { value := t.value.castSucc } }
Construct a degree by literal: deg 5 : Bounded 10.
Equations
- Degree.deg n h = { value := ⟨n, ⋯⟩ }
Instances For
Construct a threshold by literal: thr 5 : Threshold 10.
Equations
- Degree.thr n h = { value := ⟨n, h⟩ }
Instances For
Threshold-comparison meanings #
General degree operations on the discrete carriers, not
adjective-specific; decidability is inherited from the underlying
Fin order.
Positive form (tall): t < d — the strict threshold face of
Core.Order.Comparison.gt.over on the discrete carrier.
Equations
- Degree.positiveMeaning d t = (d ∈ Core.Order.Comparison.gt.over id { value := t.value.castSucc })
Instances For
Polar antonym (short): d < t, evaluated against the antonym's own
threshold (which may sit below the positive's — see Gradability.ThresholdPair).
Equations
- Degree.negativeMeaning d t = (d ∈ Core.Order.Comparison.lt.over id { value := t.value.castSucc })
Instances For
Contradictory negation (not tall): d ≤ t, the complement of
positiveMeaning. Not the polar antonym — that is negativeMeaning.
Equations
- Degree.notPositiveMeaning d t = (d ∈ Core.Order.Comparison.le.over id { value := t.value.castSucc })