Documentation

Linglib.Core.Order.Comparison

Core/Scales/Comparison.lean — reified degree comparison #

Comparison reifies the five ways a measured value relates to a threshold — =, , >, , < — as data (cf. core Ordering, reified for compare). It is the shared, theory-neutral primitive behind numeral modifiers, measure phrases, and (the measure-derived case of) gradable comparatives, per the joint degree-semantic treatment of [Ken15] and [Ret14].

It interprets two ways, both bottoming out in mathlib's order API so downstream proofs reduce into Set.mem_Ici & friends rather than a bespoke lemma set:

Main declarations #

[Ken15]'s REL reified: the relation a degree modifier draws between a measured value and a threshold.

Instances For
    @[implicit_reducible]
    Equations
    Equations
    Instances For

      Strict (Class A: >, <) vs. non-strict (bare =, Class B , ). The modifier-level Class A/B split ([GN07], [Nou10]) is isStrict restricted to the four modified forms.

      Equations
      Instances For
        @[implicit_reducible]
        Equations
        • One or more equations did not get rendered due to their size.
        def Core.Order.Comparison.rel {α : Type u_1} [Preorder α] :
        ComparisonααProp

        The order relation a Comparison stands for.

        Equations
        Instances For
          def Core.Order.Comparison.interval {α : Type u_1} [Preorder α] :
          ComparisonαSet α

          The order-interval a comparison selects, in mathlib terms: {n} / [n,∞) / (n,∞) / (-∞,n] / (-∞,n).

          Equations
          Instances For
            def Core.Order.Comparison.over {E : Type u_1} {α : Type u_2} [Preorder α] (c : Comparison) (μ : Eα) (n : α) :
            Set E

            The unifying predication: the entities whose measure μ lands in the comparison's interval. The measure varies — id for bare cardinals, a dimensional MeasureFn for measure phrases, an atom-count for classifiers.

            Equations
            Instances For
              @[simp]
              theorem Core.Order.Comparison.mem_interval {α : Type u_1} [Preorder α] (c : Comparison) (a n : α) :
              a c.interval n c.rel a n
              @[simp]
              theorem Core.Order.Comparison.mem_over {E : Type u_1} {α : Type u_2} [Preorder α] (c : Comparison) (μ : Eα) (n : α) (x : E) :
              x c.over μ n c.rel (μ x) n
              @[implicit_reducible]
              instance Core.Order.Comparison.relDecidable {α : Type u_1} [Preorder α] [DecidableEq α] [DecidableLE α] [DecidableLT α] (c : Comparison) (a n : α) :
              Decidable (c.rel a n)
              Equations
              • One or more equations did not get rendered due to their size.
              @[implicit_reducible]
              instance Core.Order.Comparison.overDecidable {E : Type u_1} {α : Type u_2} [Preorder α] [DecidableEq α] [DecidableLE α] [DecidableLT α] (c : Comparison) (μ : Eα) (n : α) (x : E) :
              Decidable (x c.over μ n)
              Equations
              @[simp]
              theorem Core.Order.Comparison.boundary_mem {α : Type u_1} [Preorder α] (c : Comparison) (n : α) :
              n c.interval n ¬c.isStrict

              Class A/B is interval-endpoint membership. A non-strict comparison (bare =, Class B /) keeps the boundary n; a strict one (Class A >/<) drops it — the whole Class A/B distinction ([GN07], [Nou10]) in one lemma.

              Set-standard comparison #

              The than-clause of a comparative supplies not a point but a set of degrees. Comparison.bounds lifts Comparison.interval from a point n to a standard set Δ — the (strict) upper/lower bounds matching the comparison's relation — and Comparison.overSet is the corresponding measure-pullback predication. The point predication over is exactly the singleton case (overSet_singleton).

              def Core.Order.Comparison.bounds {α : Type u_1} [Preorder α] :
              ComparisonSet αSet α

              The standard-set a comparison imposes: the bounds of Δ matching the comparison's relation (upperBounds/strictUpperBounds/… per case). Generalizes Comparison.interval from a point n (≡ {n}) to a standard set Δ.

              Equations
              Instances For
                def Core.Order.Comparison.overSet {E : Type u_1} {α : Type u_2} [Preorder α] (c : Comparison) (μ : Eα) (Δ : Set α) :
                Set E

                Set-standard predication: the entities whose measure bounds the whole standard set Δ. The set-standard generalization of Comparison.over and the order-theoretic core of [Hoe83]'s S-comparative; the binary NP-comparative is the singleton case (overSet_singleton).

                Equations
                Instances For
                  theorem Core.Order.Comparison.bounds_singleton {α : Type u_1} [Preorder α] (c : Comparison) (n : α) :
                  c.bounds {n} = c.interval n

                  bounds at a singleton standard collapses to the point interval.

                  @[simp]
                  theorem Core.Order.Comparison.mem_overSet {E : Type u_1} {α : Type u_2} [Preorder α] (c : Comparison) (μ : Eα) (Δ : Set α) (x : E) :
                  x c.overSet μ Δ μ x c.bounds Δ
                  @[simp]
                  theorem Core.Order.Comparison.overSet_singleton {E : Type u_1} {α : Type u_2} [Preorder α] (c : Comparison) (μ : Eα) (n : α) :
                  c.overSet μ {n} = c.over μ n

                  The NP ⊂ S bridge: the set-standard predication at a singleton standard is the point predication. Makes [Hoe83]'s NP↔S equivalence definitional.